forked from Nexus/nexus
parent
784e5254e2
commit
23046f08a9
8 changed files with 448 additions and 36 deletions
|
|
@ -6,6 +6,12 @@ class GomuksException implements Exception {
|
|||
String? get errorCode =>
|
||||
RegExp(r"^(M_[A-Z_]+)").firstMatch(message)?.group(1);
|
||||
|
||||
/// The HTTP status code of the failed request
|
||||
int? get statusCode => switch (RegExp(r"HTTP (\d{3})").firstMatch(message)) {
|
||||
final match? => int.parse(match.group(1)!),
|
||||
null => null,
|
||||
};
|
||||
|
||||
@override
|
||||
String toString() => message;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue