@codacy/api-typescript
Advanced tools
Comparing version 0.5.9 to 0.6.0
@@ -6,4 +6,4 @@ import * as Models from './models'; | ||
import { HttpOperationResponse } from '@azure/ms-rest-js'; | ||
export declare type ErrorType = 'ApiError' | 'BadRequest' | 'Unauthorized' | 'Forbidden' | 'NotFound' | 'InternalServerError'; | ||
export declare type ApiErrorUnion = Models.BadRequest | Models.Forbidden | Models.Unauthorized | Models.NotFound | Models.InternalServerError; | ||
export declare type ErrorType = 'ApiError' | 'BadRequest' | 'Unauthorized' | 'Forbidden' | 'NotFound' | 'Conflict' | 'InternalServerError'; | ||
export declare type ApiErrorUnion = Models.BadRequest | Models.Forbidden | Models.Unauthorized | Models.NotFound | Models.Conflict | Models.InternalServerError; | ||
export declare class BaseApiError extends Error { | ||
@@ -36,2 +36,5 @@ errorType: string; | ||
} | ||
export declare class ConflictApiError extends BaseApiError { | ||
constructor(error: ApiErrorUnion, response?: HttpOperationResponse, exception?: Error); | ||
} | ||
export declare class InternalServerApiError extends BaseApiError { | ||
@@ -38,0 +41,0 @@ constructor(error: ApiErrorUnion, response?: HttpOperationResponse, exception?: Error); |
@@ -97,2 +97,13 @@ import { __assign, __awaiter, __extends, __generator, __spreadArrays } from "tslib"; | ||
export { NotFoundApiError }; | ||
var ConflictApiError = /** @class */ (function (_super) { | ||
__extends(ConflictApiError, _super); | ||
function ConflictApiError(error, response, exception) { | ||
var _this = _super.call(this, error, response, exception) || this; | ||
_this.name = 'ConflictApiError'; | ||
Object.setPrototypeOf(_this, ConflictApiError.prototype); | ||
return _this; | ||
} | ||
return ConflictApiError; | ||
}(BaseApiError)); | ||
export { ConflictApiError }; | ||
var InternalServerApiError = /** @class */ (function (_super) { | ||
@@ -148,2 +159,4 @@ __extends(InternalServerApiError, _super); | ||
throw new NotFoundApiError(exception, result); | ||
case 'Conflict': | ||
throw new ConflictApiError(exception, result); | ||
case 'InternalServerError': | ||
@@ -150,0 +163,0 @@ throw new InternalServerApiError(exception, result); |
{ | ||
"name": "@codacy/api-typescript", | ||
"version": "0.5.9", | ||
"version": "0.6.0", | ||
"description": "Codacy API client for Typescript", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/codacy/codacy-api-typescript#readme", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
141568
2724