Skip to content

Conversation

@andrius-puksta-sensmetry
Copy link
Collaborator

@andrius-puksta-sensmetry andrius-puksta-sensmetry commented Oct 24, 2025

Core

  • Added a general error type FsIoError, which consolidates all filesystem I/O errors and includes relevant context. It is included in every error type that needs to represent filesystem errors.
  • Added relevant details to every error type in core.
  • Create mod wrapfs that wraps std's I/O methods that we use and adds relevant context automatically
  • Box more large errors
  • Allow unused imports in tests (#![allow(unused_imports)]) to silence warnings. These imports are used by different features and it's not worth it figuring out where exactly they are used.
  • Implements Produce explanatory error messages on lexer/parser failure #33. It now prints the name of the file that failed to parse, tries to give some explanation and mostly prints the offending piece of code. Still doesn't give the line numbers.

Java bindings

  • More safety for exceptions: add enum ExceptionKind that lists all possible Sysand exceptions and use it instead of providing string names for exceptions. Fixed one case of nonexistent exception name.
  • Make Java bindings and their tests actually work on Java 8 and enforce it in their pom.xml.
  • More ergonomic exception throwing: instead of providing &mut env on each call, implement a trait on env directly

Python bindings

  • Replaced deprecated methods with their exact counterparts (deprecated methods just called them under the hood).

WASM bindings

  • Clear localStorage on start of one test (the test uses less storage slots than the other one, and so entries form the other test are still visible). Maybe should clear localStorage at the end of every test?

Add FsIoError, which consolidates all filesystem I/O errors and includes
relevant context where possible. It is included in every error type that
needs to represent filesystem errors. Also add relevant details to every
error type in core.

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
…ropriate

Fixes warnings of Java build and test. Use non-deprecated methods of
pyo3. More safety for Java exceptions: use an enum to list all possible
exceptions.

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
…se the variant is only constructed in one place from String

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
@andrius-puksta-sensmetry
Copy link
Collaborator Author

Is it worth putting more work into addressing #33? Our sysml parser/lexer is rudimentary, so it will not produce semantically meaningful error messages, just basic parse errors. Also it is kind of half automatic, half manual, which makes it much harder to include meaningful error context, as that context has to travel through 5+ functions and thus should be refected in all their signatures...

@tilowiklundSensmetry
Copy link
Member

Is it worth putting more work into addressing #33? Our sysml parser/lexer is rudimentary, so it will not produce semantically meaningful error messages, just basic parse errors. Also it is kind of half automatic, half manual, which makes it much harder to include meaningful error context, as that context has to travel through 5+ functions and thus should be refected in all their signatures...

Let's not put a lot of effort into this right now, since we are not even sure for how long we will keep this lexer implementation. I think it might be worth to hack something that at least displays some basic context indicating where the error occurred though.

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
@andrius-puksta-sensmetry
Copy link
Collaborator Author

andrius-puksta-sensmetry commented Oct 29, 2025

PR finished and ready for review.

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
@andrius-puksta-sensmetry andrius-puksta-sensmetry changed the title refactor(core)!: add more details to errors refactor(all)!: add more details to errors Oct 31, 2025
Copy link
Member

@tilowiklundSensmetry tilowiklundSensmetry left a comment

Choose a reason for hiding this comment

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

Looks great! There are still some ergonomics issues with error reporting from the actual CLI, but I think those are better treated one (sub)command at a time.

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
@andrius-puksta-sensmetry andrius-puksta-sensmetry merged commit 8956e20 into main Oct 31, 2025
29 of 31 checks passed
@andrius-puksta-sensmetry andrius-puksta-sensmetry deleted the ap/detailed-errors branch October 31, 2025 14:19
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.

3 participants