forked from loafle/openapi-generator-original
fix[dart2]: improved error reporting (#1006)
* fix[dart]: improved error reporting * rebuilt dart2 petstore * rebuilt dart2 petstore with dartfmt
This commit is contained in:
parent
f80fa08a01
commit
6a1e560540
@ -70,7 +70,7 @@ class ApiClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e, stack) {
|
} on Exception catch (e, stack) {
|
||||||
throw ApiException.withInner(500, 'Exception during deserialization.', e, stack);
|
throw ApiException.withInner(500, 'Exception during deserialization.', e, stack);
|
||||||
}
|
}
|
||||||
throw ApiException(500, 'Could not find a suitable class for deserialization');
|
throw ApiException(500, 'Could not find a suitable class for deserialization');
|
||||||
|
@ -41,7 +41,8 @@ class PetApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -85,7 +86,8 @@ class PetApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -265,7 +267,8 @@ class PetApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -319,7 +322,8 @@ class PetApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,8 @@ class StoreApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,8 @@ class UserApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -82,7 +83,8 @@ class UserApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -123,7 +125,8 @@ class UserApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -166,7 +169,8 @@ class UserApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -299,7 +303,8 @@ class UserApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -345,7 +350,8 @@ class UserApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ class ApiClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e, stack) {
|
} on Exception catch (e, stack) {
|
||||||
throw ApiException.withInner(
|
throw ApiException.withInner(
|
||||||
500, 'Exception during deserialization.', e, stack);
|
500, 'Exception during deserialization.', e, stack);
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,8 @@ class PetApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -85,7 +86,8 @@ class PetApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -265,7 +267,8 @@ class PetApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -319,7 +322,8 @@ class PetApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,8 @@ class StoreApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,8 @@ class UserApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -82,7 +83,8 @@ class UserApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -123,7 +125,8 @@ class UserApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -166,7 +169,8 @@ class UserApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -299,7 +303,8 @@ class UserApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -345,7 +350,8 @@ class UserApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ class ApiClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e, stack) {
|
} on Exception catch (e, stack) {
|
||||||
throw ApiException.withInner(
|
throw ApiException.withInner(
|
||||||
500, 'Exception during deserialization.', e, stack);
|
500, 'Exception during deserialization.', e, stack);
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,8 @@ class PetApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -85,7 +86,8 @@ class PetApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -265,7 +267,8 @@ class PetApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -319,7 +322,8 @@ class PetApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,8 @@ class StoreApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,8 @@ class UserApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -82,7 +83,8 @@ class UserApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -123,7 +125,8 @@ class UserApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -166,7 +169,8 @@ class UserApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -299,7 +303,8 @@ class UserApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -345,7 +350,8 @@ class UserApi {
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new ApiException(response.statusCode, response.body);
|
throw new ApiException(response.statusCode, response.body);
|
||||||
} else if (response.body != null) {} else {
|
} else if (response.body != null) {
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ class ApiClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e, stack) {
|
} on Exception catch (e, stack) {
|
||||||
throw ApiException.withInner(
|
throw ApiException.withInner(
|
||||||
500, 'Exception during deserialization.', e, stack);
|
500, 'Exception during deserialization.', e, stack);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user