From 7f963ac4bc6775305a1a5592a3873b476d68c6fd Mon Sep 17 00:00:00 2001 From: Ashish Surana Date: Mon, 8 Oct 2018 11:04:40 +0530 Subject: [PATCH] refactor: change API error to API_ERROR constants (#1063) --- src/api/endpoint/api/package.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/endpoint/api/package.js b/src/api/endpoint/api/package.js index cd8df81ff..c5432b42d 100644 --- a/src/api/endpoint/api/package.js +++ b/src/api/endpoint/api/package.js @@ -6,7 +6,7 @@ import _ from 'lodash'; import { allow } from '../../middleware'; import { convertDistRemoteToLocalTarballUrls, getVersion, ErrorCode } from '../../../lib/utils'; -import { HEADERS, DIST_TAGS } from '../../../lib/constants'; +import { HEADERS, DIST_TAGS, API_ERROR } from '../../../lib/constants'; import type { Router } from 'express'; import type { Config } from '@verdaccio/types'; import type { IAuth, $ResponseExtend, $RequestExtend, $NextFunctionVer, IStorageHandler } from '../../../../types'; @@ -40,7 +40,7 @@ export default function(route: Router, auth: IAuth, storage: IStorageHandler, co } } } - return next(ErrorCode.getNotFound(`version not found: ${req.params.version}`)); + return next(ErrorCode.getNotFound(`${API_ERROR.VERSION_NOT_EXIST}: ${req.params.version}`)); }; storage.getPackage({