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

Not very helpful error messages #167

Open
danmichaelo opened this issue May 31, 2022 · 1 comment
Open

Not very helpful error messages #167

danmichaelo opened this issue May 31, 2022 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@danmichaelo
Copy link

danmichaelo commented May 31, 2022

I know that producing good error messages is hard, but the information in the error messages from this tool is often not enough to locate which mapping caused the error in a large mapping set. Here's an example:

10:42:04.062 [main] ERROR be.ugent.rml.cli.Main               .main(393) - For input string: "1533887350415"

There's no information about what kind of error it is or which source/column it was pulled from.

I'm not familiar with Java, but I tried adding a stack trace print (most likely not the most elegant way to do so :D):

StringWriter writer = new StringWriter();
PrintWriter printWriter = new PrintWriter( writer );
e.printStackTrace( printWriter );
printWriter.flush();
String stackTrace = writer.toString();
logger.error(stackTrace);

It revealed one additional piece of useful information, that the error was caused by converting a large number to int:

10:43:56.326 [main] ERROR be.ugent.rml.cli.Main               .main(401) - java.lang.NumberFormatException: For input string: "1533887350415"
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
	at java.base/java.lang.Integer.parseInt(Integer.java:668)
	at java.base/java.lang.Integer.parseInt(Integer.java:784)
	at be.ugent.rml.Utils.transformDatatypeString(Utils.java:595)
	at be.ugent.rml.termgenerator.LiteralGenerator.lambda$generate$0(LiteralGenerator.java:87)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at be.ugent.rml.termgenerator.LiteralGenerator.generate(LiteralGenerator.java:63)
	at be.ugent.rml.Executor.generatePredicateObjectGraphs(Executor.java:277)
	at be.ugent.rml.Executor.executeWithFunctionV5(Executor.java:233)
	at be.ugent.rml.Executor.executeV5(Executor.java:152)
	at be.ugent.rml.cli.Main.main(Main.java:371)
	at be.ugent.rml.cli.Main.main(Main.java:45)

Should stack traces be printed by default? Perhaps? Or perhaps just the first part? If possible, it would also be awesome if the error could include information about which source/column caused the error.

@DylanVanAssche
Copy link
Contributor

Thanks for reporting this! It is indeed on our radar to improve the error messages, but as you mentioned it is hard.

@DylanVanAssche DylanVanAssche added enhancement New feature or request help wanted Extra attention is needed labels Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants