add statuscode to apiexception

This commit is contained in:
Pascal Schedel
2024-10-25 07:35:03 +02:00
parent e3ce952cbc
commit 25a8cd48be
3 changed files with 12 additions and 3 deletions

View File

@@ -15,7 +15,7 @@ public record class ApiResponse<T>(
public T EnsureOk()
{
if (!IsOk)
throw new ApiException("Api return is not ok: " + StatusCode);
throw new ApiException("Api return is not ok or message invalid: " + StatusCode, StatusCode);
return Message;
}
}