Skip to content

Commit

Permalink
feat: add message for signin required exception
Browse files Browse the repository at this point in the history
  • Loading branch information
poppingmoon committed Dec 16, 2024
1 parent 9cf5356 commit aab07e2
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions lib/view/widget/error_message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,21 @@ class ErrorMessage extends HookConsumerWidget {
'NO_SUCH_ROLE' => [t.misskey.noRole],
'NAME_ALREADY_EXISTS' => [t.misskey.pages_.nameAlreadyExists],
'NO_SUCH_USER' || 'USER_NOT_FOUND' => [t.misskey.noSuchUser],
_ => error.code.startsWith('TOO_MANY')
? [
t.misskey.youCannotCreateAnymore,
error.message,
error.id,
]
: [
error.code,
error.message,
if (error.info != null)
const JsonEncoder.withIndent(' ').convert(error.info),
]
'CREDENTIAL_REQUIRED' => [t.misskey.signinRequired],
'SIGNIN_REQUIRED' => [
t.misskey.thisContentsAreMarkedAsSigninRequiredByAuthor,
],
_ when error.code.startsWith('TOO_MANY') => [
t.misskey.youCannotCreateAnymore,
error.message,
error.id,
],
_ => [
error.code,
error.message,
if (error.info case final info?)
const JsonEncoder.withIndent(' ').convert(info),
]
}
.join('\n'),
DioException(:final type, :final response, :final error) => [
Expand Down

0 comments on commit aab07e2

Please sign in to comment.