Skip to content

Commit 9cd6ddb

Browse files
committed
fix: typing for cs
1 parent fee6a70 commit 9cd6ddb

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

templates/dotnet/Package/Exception.cs.twig

+9-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@ using System;
22

33
namespace {{spec.title | caseUcfirst}}
44
{
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+
513
public class {{spec.title | caseUcfirst}}Exception : Exception
614
{
715
public int? Code { get; set; }
@@ -16,7 +24,7 @@ namespace {{spec.title | caseUcfirst}}
1624
{
1725
this.Code = code;
1826
this.Type = type;
19-
this.Response = response;
27+
this.Response = response is string or Response ? response : null;
2028
}
2129
public {{spec.title | caseUcfirst}}Exception(string message, Exception inner)
2230
: base(message, inner)

templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig

+1-1
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ class Client @JvmOverloads constructor(
535535
map["message"] as? String ?: "",
536536
(map["code"] as Number).toInt(),
537537
map["type"] as? String ?: "",
538-
body
538+
map as? ErrorResult.Response ?: ErrorResult.Text("")
539539
)
540540
} else {
541541
{{ spec.title | caseUcfirst }}Exception(body, response.code)

0 commit comments

Comments
 (0)