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
refactor(mobile): move error details to separate DB column #6898
Conversation
@shenlong-tanwen: PTAL |
mobile/lib/modules/asset_viewer/services/image_viewer.service.dart
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the PR!
4d25be8
to
91fda25
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
2482e84
to
15b50ac
Compare
That's funny... first it complains that final failedResponse =
imageResponse.statusCode != 200 ? imageResponse : motionReponse;
_log.severe("Motion asset download failed", failedResponse.toLoggerString());
return false; is bad and formats it to final failedResponse =
imageResponse.statusCode != 200 ? imageResponse : motionReponse;
_log.severe(
"Motion asset download failed", failedResponse.toLoggerString());
return false; (which is less readable from my point of view). final failedResponse =
imageResponse.statusCode != 200 ? imageResponse : motionReponse;
_log.severe(
"Motion asset download failed", failedResponse.toLoggerString(),);
return false; The end? No, the formatter wants some changes again: final failedResponse =
imageResponse.statusCode != 200 ? imageResponse : motionReponse;
_log.severe(
"Motion asset download failed",
failedResponse.toLoggerString(),
);
return false; Looks better at least, but it pushed a simply log message from one to four lines and made it seem more important than it needs to be. Similar for the line above that. I thought the formatter is supposed to improve readability but, the 80 character limit achieves the opposite in my eyes (literally 😁). OK. Rant over, Dart seems to be happy now, so hopefully ready to merge. 😉 |
As discussed in #6866,
logRecord.error
previously wasn't stored in the DB. Instead, a string copy of it was merged into themessage
in most places. Separate the two, so the log overview shows a brief description of the error while the details (usually an exception, but could be any string) can be found in the details page.I adjusted many places to split the log message into its headline and the details, but for sure there will be some that I've missed. It shouldn't be a problem to adjust those later. There might also be places where adding further details as string could be helpful, like a few statistics when the upload has finished.