Skip to content

Conversation

@bact
Copy link
Contributor

@bact bact commented Jun 10, 2025

  • Make LogCountingHandler stores error messages for later use
  • Add LogCountingHandler to mdparsing.py, model.py, and rdf.py
  • After the generation in main.py, print error messages and exit(1) if there is an error

To resolve #80

The error messages will look like this:

Markdown parsing errors: 1
1: Single list parsing error in line `- file The file represents a single file (default).'

Model errors: 3
2: In class /AI/AIPackage, property autonomyType has type /Core/PresenceType but the range of /AI/autonomyType is /Core/PrssesenceType
3: In class /Software/ContentIdentifier, property contentIdentifierType has type ContentIdentierType but the range of /Software/contentIdentifierType is ContentIdentifierType
4: In class /Software/ContentIdentifier, property contentIdentifierValue has type xsd:anURI but the range of /Software/contentIdentifierValue is xsd:anyURI

Total errors: 4

exit(1) if there is an error in the log

Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
bact added 5 commits June 11, 2025 02:07
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
@bact bact changed the title Add LogCountingHandler to Model exit(1) and print error messages at the end of program if there's an error Jun 10, 2025
bact added 3 commits June 11, 2025 20:11
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Copy link
Contributor

@JPEWdev JPEWdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some comments on this, but I'm away from my computer to do a proper review, but I'll look at it later

@zvr
Copy link
Member

zvr commented Jun 24, 2025

I am also away this week, so I can't comment extensively, but I disagree with this PR.

  • There is on need to add the handling to other loggers, since it should be inherited from the parent one.
  • There is no point in collecting the error messages instead of printing them.
  • Keep in mind that the error handling will be changed significantly, so that, for example, errors in parsing actually report files and section where the error was encountered. I plan to submit this PR next week (already implemented).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

spec-parser run reports errors but exits with 0

3 participants