Browse Source

Merge pull request #6516 from abpframework/feat/6515

Proxy Generator: Included URL info to API Not Available error
pull/6541/head
Bunyamin Coskuner 6 years ago
committed by GitHub
parent
commit
5d8bd9da82
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      npm/ng-packs/packages/schematics/src/enums/exception.ts
  2. 2
      npm/ng-packs/packages/schematics/src/utils/source.ts

2
npm/ng-packs/packages/schematics/src/enums/exception.ts

@ -5,7 +5,7 @@ export const enum Exception {
InvalidModule = '[Invalid Module] Backend module "{0}" does not exist in API definition.',
InvalidApiDefinition = '[Invalid API Definition] The provided API definition is invalid.',
InvalidWorkspace = '[Invalid Workspace] The angular.json should be a valid JSON file.',
NoApi = '[API Not Available] Please double-check the URL in the source project environment and make sure your application is up and running.',
NoApi = '[API Not Available] Request to {0} is unsuccessful. Please double-check the URL in the source project environment and make sure your application is up and running.',
NoProject = '[Project Not Found] Either define a default project in your workspace or specify the project name in schematics options.',
NoProxyConfig = '[Proxy Config Not Found] There is no JSON file at "{0}".',
NoTypeDefinition = '[Type Definition Not Found] There is no type definition for "{0}".',

2
npm/ng-packs/packages/schematics/src/utils/source.ts

@ -36,7 +36,7 @@ async function getApiDefinition(sourceUrl: string) {
} catch ({ response }) {
// handle redirects
if (!response?.body || response.statusCode >= 400)
throw new SchematicsException(Exception.NoApi);
throw new SchematicsException(interpolate(Exception.NoApi, url));
body = response.body;
}

Loading…
Cancel
Save