mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
chore: show error message in upload details route (#22472)
* chore: show error message in upload details route * pretty format exception --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
ee3c07d049
commit
75b9bd163e
3 changed files with 48 additions and 8 deletions
|
|
@ -1,3 +1,5 @@
|
|||
import 'dart:convert';
|
||||
|
||||
extension StringExtension on String {
|
||||
String capitalize() {
|
||||
return split(" ").map((str) => str.isEmpty ? str : str[0].toUpperCase() + str.substring(1)).join(" ");
|
||||
|
|
@ -23,3 +25,11 @@ extension DurationExtension on String {
|
|||
return int.parse(this);
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic>? tryJsonDecode(dynamic json) {
|
||||
try {
|
||||
return jsonDecode(json) as Map<String, dynamic>;
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue