1
0
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:
2020-04-30 13:32:22 +02:00
parent d64d2ece05
commit 29cc8558c3
7 changed files with 136 additions and 2 deletions

View File

@ -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);
}

View File

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