Skip to content

Commit 1c68ec6

Browse files
committed
improve postgrest error messages
1 parent b009d3c commit 1c68ec6

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Postgrest/src/commonMain/kotlin/io/github/jan/supabase/postgrest/exception/PostgrestRestException.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class PostgrestRestException(
1919
val code: String?,
2020
response: HttpResponse
2121
): RestException(message, """
22-
|Hint: $hint
23-
|Details: $details
22+
Code: $code
23+
Hint: $hint
24+
Details: $details
2425
""".trimIndent(), response)

Supabase/src/commonMain/kotlin/io/github/jan/supabase/exceptions/RestException.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import io.ktor.client.statement.request
1616
* @see UnknownRestException
1717
*/
1818
open class RestException(val error: String, val description: String?, val response: HttpResponse): Exception("""
19-
$error${description?.let { " ($it)" } ?: ""}
19+
$error${description?.let { "\n$it" } ?: ""}
2020
URL: ${response.request.url}
2121
Headers: ${response.request.headers.entries()}
2222
Http Method: ${response.request.method.value}

0 commit comments

Comments
 (0)