add better OAuth error

Fixes #88
This commit is contained in:
Henry Hiles 2026-10-15 18:30:12 -04:00
commit df592b3f38
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
3 changed files with 35 additions and 4 deletions

View 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;
}