File tree 2 files changed +10
-2
lines changed
kotlin/src/main/kotlin/io/appwrite
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,14 @@ using System;
2
2
3
3
namespace {{spec .title | caseUcfirst }}
4
4
{
5
+ public class Response
6
+ {
7
+ public string Message { get; set; }
8
+ public int Code { get; set; }
9
+ public string Type { get; set; }
10
+ public string Version { get; set; }
11
+ }
12
+
5
13
public class {{spec .title | caseUcfirst }}Exception : Exception
6
14
{
7
15
public int? Code { get; set; }
@@ -16,7 +24,7 @@ namespace {{spec.title | caseUcfirst}}
16
24
{
17
25
this.Code = code;
18
26
this.Type = type;
19
- this.Response = response;
27
+ this.Response = response is string or Response ? response : null ;
20
28
}
21
29
public {{spec .title | caseUcfirst }}Exception(string message, Exception inner)
22
30
: base(message, inner)
Original file line number Diff line number Diff line change @@ -535,7 +535,7 @@ class Client @JvmOverloads constructor(
535
535
map["message"] as? String ?: "",
536
536
(map["code"] as Number).toInt(),
537
537
map["type"] as? String ?: "",
538
- body
538
+ map as? ErrorResult.Response ?: ErrorResult.Text("")
539
539
)
540
540
} else {
541
541
{{ spec .title | caseUcfirst }}Exception(body, response.code)
You can’t perform that action at this time.
0 commit comments