parent
d47c4ae15c
commit
df592b3f38
3 changed files with 35 additions and 4 deletions
11
lib/models/gomuks_exception.dart
Normal file
11
lib/models/gomuks_exception.dart
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
class GomuksException implements Exception {
|
||||
final String message;
|
||||
const GomuksException(this.message);
|
||||
|
||||
/// The Matrix error code, if gomuks returned an error in the form `M_CODE (HTTP 404): message`
|
||||
String? get errorCode =>
|
||||
RegExp(r"^(M_[A-Z_]+)").firstMatch(message)?.group(1);
|
||||
|
||||
@override
|
||||
String toString() => message;
|
||||
}
|
||||
Loading…
Reference in a new issue