Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message for incorrect use of % #73

Open
MacSplody opened this issue Mar 16, 2021 · 1 comment
Open

Error message for incorrect use of % #73

MacSplody opened this issue Mar 16, 2021 · 1 comment

Comments

@MacSplody
Copy link
Member

At the moment incorrect usage of % will display the following error.

ERROR: boost::bad_format_string: format-string is ill-formed

Working version:

  - &alreadyInX
    type: error
    content:
      - lang: en
        text: 'Delete. Already included in %1%.'
  - &alreadyInEnderalDLC
    <<: *alreadyInX
    subs: [ 'Enderal - Forgotten Stories.esm' ]
    condition: 'file("Enderal - Forgotten Stories.esm")'

Changes that will cause the error:

'Delete. Already included in 1%.'
or
'Delete. Already included in %1.'
or
'Delete. Already included in %1%%.'

So if possible we should show where the error is happening.

@Ortham
Copy link
Member

Ortham commented Mar 16, 2021

This would have to be done in libloot, as the bad_format_string exception thrown has get_pos() and get_next() member functions, which are only useful in a context that also has the formatting string input. With them, we might be able to have errors like `format-string is ill-formed at "1%.", which is a little more useful.

@Ortham Ortham transferred this issue from loot/metadata-validator Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants