Skip to content
This repository has been archived by the owner on Nov 22, 2019. It is now read-only.

Commit

Permalink
Handle vdb deployment errors
Browse files Browse the repository at this point in the history
* vdb.service.ts
 * Correctly handles the status object returned from a vdb deployment by
   assessing its deployment success flag

* api.service.ts
 * Handle status object error messages ensuring they get printed to the
   console.
  • Loading branch information
phantomjinx committed Mar 26, 2018
1 parent aeeebe5 commit bf40433
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ngapp/src/app/core/api.service.ts
Expand Up @@ -88,6 +88,8 @@ export abstract class ApiService {
msg = body.message;
else if (body.error)
msg = body.error;
else if (body.Information && body.Information.ErrorMessage1)
msg = body.Information.ErrorMessage1;
}

if (msg.length === 0 ) {
Expand Down
7 changes: 6 additions & 1 deletion ngapp/src/app/dataservices/shared/vdb.service.ts
Expand Up @@ -176,7 +176,12 @@ export class VdbService extends ApiService {
.post(environment.komodoTeiidUrl + VdbsConstants.vdbRootPath,
{ path: vdbPath}, this.getAuthRequestOptions())
.map((response) => {
return response.ok;
let status = response.json();
if (status.Information.deploymentSuccess !== 'true') {
this.handleError(response);
}

return status.Information.deploymentSuccess === 'true';
})
.catch( ( error ) => this.handleError( error ) );
}
Expand Down

0 comments on commit bf40433

Please sign in to comment.