Skip to content

Conversation

@glyh
Copy link
Member

@glyh glyh commented Dec 16, 2025

As title. This is designed because of https://discord.com/channels/484437221055922177/1450202839430201506

Their daemon died without any messages logged.

@glyh glyh requested a review from cjjdespres December 16, 2025 02:51
| Ok _ ->
Async.never ()
| Error exn ->
[%log fatal] "Unhandled Async exception %s" (Exn.to_string exn) ;
Copy link
Member

Choose a reason for hiding this comment

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

There's a handle_crash method in init/mina_run.ml that renders exceptions to json like this:

let exn_json = Error_json.error_to_yojson (Error.of_exn ~backtrace:`Get e) in
[%log' fatal top_logger]
"Unhandled top-level exception: $exn\nGenerating crash report"
~metadata:[ ("exn", exn_json) ] ;

Can something similar be used here and in the other place, so we get more structured errors in the logs?

Copy link
Member Author

Choose a reason for hiding this comment

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

Make sense, will patch

@cjjdespres
Copy link
Member

Is there any easy way of triggering an exception that would be caught and logged in these places? I'm mostly curious what the new log message would actually look like, to see if it would have been helpful to the user from that discord thread or not.

@glyh
Copy link
Member Author

glyh commented Dec 17, 2025

Misconfigured wallet is one of them, I could add unit tests.

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