Skip to content

Commit

Permalink
chore: rename api-error to unleash-error
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasheartman committed May 11, 2023
1 parent aa21d78 commit 71cf907
Show file tree
Hide file tree
Showing 24 changed files with 23 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/lib/error/bad-data-error.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ErrorObject } from 'ajv';
import getProp from 'lodash.get';
import { ApiErrorSchema, UnleashError } from './api-error';
import { ApiErrorSchema, UnleashError } from './unleash-error';

type ValidationErrorDescription = {
description: string;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/error/content-type-error.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UnleashError } from './api-error';
import { UnleashError } from './unleash-error';

class ContentTypeError extends UnleashError {
constructor(
Expand Down
2 changes: 1 addition & 1 deletion src/lib/error/disabled-error.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UnleashError } from './api-error';
import { UnleashError } from './unleash-error';

class DisabledError extends UnleashError {}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/error/feature-has-tag-error.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UnleashError } from './api-error';
import { UnleashError } from './unleash-error';

class FeatureHasTagError extends UnleashError {}
export default FeatureHasTagError;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/error/incompatible-project-error.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ApiErrorSchema, UnleashError } from './api-error';
import { ApiErrorSchema, UnleashError } from './unleash-error';

export default class IncompatibleProjectError extends UnleashError {
constructor(targetProject: string) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/error/invalid-operation-error.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UnleashError } from './api-error';
import { UnleashError } from './unleash-error';

class InvalidOperationError extends UnleashError {}
export default InvalidOperationError;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/error/invalid-token-error.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UnleashError } from './api-error';
import { UnleashError } from './unleash-error';

class InvalidTokenError extends UnleashError {
constructor() {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/error/minimum-one-environment-error.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UnleashError } from './api-error';
import { UnleashError } from './unleash-error';

class MinimumOneEnvironmentError extends UnleashError {}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/error/name-exists-error.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UnleashError } from './api-error';
import { UnleashError } from './unleash-error';

class NameExistsError extends UnleashError {}
export default NameExistsError;
Expand Down
3 changes: 1 addition & 2 deletions src/lib/error/no-access-error.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ApiErrorSchema } from './api-error';
import { UnleashError } from './api-error';
import { ApiErrorSchema, UnleashError } from './unleash-error';

class NoAccessError extends UnleashError {
permission: string;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/error/not-implemented-error.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UnleashError } from './api-error';
import { UnleashError } from './unleash-error';

class NotImplementedError extends UnleashError {}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/error/notfound-error.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UnleashError } from './api-error';
import { UnleashError } from './unleash-error';

class NotFoundError extends UnleashError {
constructor(message: string = 'The requested resource could not be found') {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/error/operation-denied-error.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { UnleashError } from './api-error';
import { UnleashError } from './unleash-error';

export class OperationDeniedError extends UnleashError {}
2 changes: 1 addition & 1 deletion src/lib/error/owasp-validation-error.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TestResult } from 'owasp-password-strength-test';
import { ApiErrorSchema, UnleashError } from './api-error';
import { ApiErrorSchema, UnleashError } from './unleash-error';

type ValidationError = {
validationErrors: string[];
Expand Down
2 changes: 1 addition & 1 deletion src/lib/error/password-mismatch.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UnleashError } from './api-error';
import { UnleashError } from './unleash-error';

class PasswordMismatch extends UnleashError {
constructor(message: string = 'Wrong password, try again.') {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/error/password-undefined.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ApiErrorSchema, UnleashError } from './api-error';
import { ApiErrorSchema, UnleashError } from './unleash-error';

export default class PasswordUndefinedError extends UnleashError {
constructor() {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/error/project-without-owner-error.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ApiErrorSchema, UnleashError } from './api-error';
import { ApiErrorSchema, UnleashError } from './unleash-error';

export default class ProjectWithoutOwnerError extends UnleashError {
constructor() {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/error/role-in-use-error.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UnleashError } from './api-error';
import { UnleashError } from './unleash-error';

class RoleInUseError extends UnleashError {}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/error/unauthorized-error.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UnleashError } from './api-error';
import { UnleashError } from './unleash-error';

class UnauthorizedError extends UnleashError {}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import owasp from 'owasp-password-strength-test';
import { ErrorObject } from 'ajv';
import AuthenticationRequired from '../types/authentication-required';
import { ApiErrorSchema, fromLegacyError } from './api-error';
import { ApiErrorSchema, fromLegacyError } from './unleash-error';
import BadDataError, {
fromOpenApiValidationError,
fromOpenApiValidationErrors,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/lib/error/used-token-error.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UnleashError } from './api-error';
import { UnleashError } from './unleash-error';

class UsedTokenError extends UnleashError {
constructor(usedAt: Date) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/routes/util.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import joi from 'joi';
import { Response } from 'express';
import { Logger } from '../logger';
import { fromLegacyError, UnleashError } from '../error/api-error';
import { fromLegacyError, UnleashError } from '../error/unleash-error';

export const customJoi = joi.extend((j) => ({
type: 'isUrlFriendly',
Expand Down
2 changes: 1 addition & 1 deletion src/lib/types/authentication-required.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ApiErrorSchema, UnleashError } from '../error/api-error';
import { ApiErrorSchema, UnleashError } from '../error/unleash-error';

interface IBaseOptions {
type: string;
Expand Down

0 comments on commit 71cf907

Please sign in to comment.