mirror of
https://gitlab.com/veilid/veilid.git
synced 2025-07-26 16:35:24 -04:00
error cleanup
This commit is contained in:
parent
97be49a9a7
commit
697ac5e9ce
35 changed files with 205 additions and 251 deletions
|
@ -22,7 +22,7 @@ abstract class VeilidAPIException implements Exception {
|
|||
}
|
||||
case 'TryAgain':
|
||||
{
|
||||
return VeilidAPIExceptionTryAgain();
|
||||
return VeilidAPIExceptionTryAgain(json['message']! as String);
|
||||
}
|
||||
case 'Shutdown':
|
||||
{
|
||||
|
@ -30,7 +30,7 @@ abstract class VeilidAPIException implements Exception {
|
|||
}
|
||||
case 'InvalidTarget':
|
||||
{
|
||||
return VeilidAPIExceptionInvalidTarget();
|
||||
return VeilidAPIExceptionInvalidTarget(json['message']! as String);
|
||||
}
|
||||
case 'NoConnection':
|
||||
{
|
||||
|
@ -108,11 +108,14 @@ class VeilidAPIExceptionTimeout implements VeilidAPIException {
|
|||
|
||||
@immutable
|
||||
class VeilidAPIExceptionTryAgain implements VeilidAPIException {
|
||||
//
|
||||
const VeilidAPIExceptionTryAgain(this.message);
|
||||
final String message;
|
||||
@override
|
||||
String toString() => 'VeilidAPIException: TryAgain';
|
||||
String toString() => 'VeilidAPIException: TryAgain (message: $message)';
|
||||
|
||||
@override
|
||||
String toDisplayError() => 'Try again';
|
||||
String toDisplayError() => 'Try again: (message: $message)';
|
||||
}
|
||||
|
||||
@immutable
|
||||
|
@ -126,11 +129,15 @@ class VeilidAPIExceptionShutdown implements VeilidAPIException {
|
|||
|
||||
@immutable
|
||||
class VeilidAPIExceptionInvalidTarget implements VeilidAPIException {
|
||||
@override
|
||||
String toString() => 'VeilidAPIException: InvalidTarget';
|
||||
//
|
||||
const VeilidAPIExceptionInvalidTarget(this.message);
|
||||
final String message;
|
||||
|
||||
@override
|
||||
String toDisplayError() => 'Invalid target';
|
||||
String toString() => 'VeilidAPIException: InvalidTarget (message: $message)';
|
||||
|
||||
@override
|
||||
String toDisplayError() => 'Invalid target: (message: $message)';
|
||||
}
|
||||
|
||||
@immutable
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue