Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #100 from panxl6/master
Browse files Browse the repository at this point in the history
fix: change ApiError.code type to number
  • Loading branch information
Bossa573 authored Dec 18, 2023
2 parents 2f066b5 + d2250a2 commit 9a47266
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [7.1.0] 2023-12-20
### Breaking Changes
- change ApiError.code type to number|null.

## [7.0.6] 2023-05-18
### Added
- tracking object add new fileds
Expand Down
6 changes: 3 additions & 3 deletions src/error/error.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
export class AftershipError extends Error {
public type: string | undefined;
public code: string;
public code: number | null;
public data: any;
public responseBody: string;

constructor(type?: string, message?: string) {
super(message);
this.type = type;
this.code = '';
this.code = null;
this.data = {};
this.responseBody = '';
}
Expand Down Expand Up @@ -52,7 +52,7 @@ export class AftershipError extends Error {
if (responseBody === null || responseBody === undefined) {
// Can't get the response body, set 500 error by default
error.type = 'InternalError';
error.code = '500';
error.code = 500;
return error;
}

Expand Down

0 comments on commit 9a47266

Please sign in to comment.