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

Shorten excessively long genotype data parsing warnings just as we do with errors #244

Closed
nevrome opened this issue Apr 18, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@nevrome
Copy link
Member

nevrome commented Apr 18, 2023

In Main-trident.hs we have a mechanism that catches every exception thrown by any subcommand and logs it neatly with logError. It also shortens overly long error messages, as they can occur in case of genotype data parsing failure with binary-encoded .geno files. @scarlhoff just made me aware that these long messages can also emerge as WARNINGS in validate. They then bypass the shortening mechanism applied to exceptions and fill the command line with hundreds of lines of gibberish.

This is something that happens rather frequently to our users and should be treated as a bug.

I'm not sure what's the best way to fix this, but the existing exception shortening is certainly not sufficient. I think I would like to keep it around, because it's cheap and covers a large range of unexpected situations. Maybe we just rework this particular error message as already requested in #224. Then it doesn't matter if it emerges as part of an error (like e.g. in forge) or just as a warning (as in validate).

@nevrome nevrome added the bug Something isn't working label Apr 18, 2023
@nevrome nevrome changed the title Shorten excessively long wanrings just as we do with errors Shorten excessively long genotype data parsing warnings just as we do with errors Apr 18, 2023
@stschiff
Copy link
Member

Upon join discussion, we identified

) (throwIO . PoseidonGenotypeExceptionForward)
as a possible entry point for improvement.

        -- ) (throwIO . PoseidonGenotypeExceptionForward)
        ) handleLowLevelException
    return pac

handleLowLevelException :: Exception -> IO ()
handleLowLevelException (AB.ParsingError e) = undefined
handleLowLevelException (AB.ParsingError e) = undefined
handleLowLevelException e = throwIO . PoseidonGenotypeExceptionForward $ e

@stschiff stschiff self-assigned this Aug 14, 2023
@nevrome
Copy link
Member Author

nevrome commented Jul 11, 2024

#299 should solve this. Error shortening is now exclusively done for genotype data parsing exceptions, but then also when they emerge on the warning log-level.

@nevrome nevrome closed this as completed Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants