mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-19 00:05:16 +00:00
Can ask user his password
This commit is contained in:
@ -66,6 +66,9 @@ class APIRequest {
|
||||
/// Execute the request
|
||||
Future<APIResponse> exec() async => APIHelper().exec(this);
|
||||
|
||||
/// Execute the request, throws an exception in case of failure
|
||||
Future<APIResponse> execWithThrow() async => (await exec()).assertOk();
|
||||
|
||||
/// Execute the request with files
|
||||
Future<APIResponse> execWithFiles() async => APIHelper().execWithFiles(this);
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ class APIResponse {
|
||||
APIResponse assertOk() {
|
||||
|
||||
if(!this.isOK)
|
||||
throw Exception("Request failed with status $code");
|
||||
throw Exception("Request failed with status $code -> $content");
|
||||
|
||||
return this;
|
||||
}
|
||||
|
Reference in New Issue
Block a user