Skip to content

Commit

Permalink
style(constants): rename constants
Browse files Browse the repository at this point in the history
  • Loading branch information
galta95 committed Dec 3, 2020
1 parent 10a8f73 commit 85424fe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/api/v6/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
NotAllowedError,
ChangesetAlreadyClosedError,
} from '../../lib/errors';
import { ownerMismatch } from '../../lib/constants';
import { OWNER_MISMATCH } from '../../lib/constants';
class Apiv6 {
private readonly httpClient: AxiosInstance;

Expand Down Expand Up @@ -52,7 +52,7 @@ class Apiv6 {
} else if (axiosError.response?.status === StatusCodes.NOT_FOUND) {
throw new ChangesetNotFoundError(axiosError);
} else if (axiosError.response?.status === StatusCodes.CONFLICT) {
if (axiosError.response.data === ownerMismatch) {
if (axiosError.response.data === OWNER_MISMATCH) {
throw new OwnerMismatchError(axiosError);
}
throw new ChangesetAlreadyClosedError(axiosError);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/constants.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const ownerMismatch = "The user doesn't own that changeset";
export const OWNER_MISMATCH = "The user doesn't own that changeset";

0 comments on commit 85424fe

Please sign in to comment.