UI: Show detailed error response on failed secret-engine list call (#13035)

This commit is contained in:
Chelsea Shaw 2021-11-09 14:42:46 -06:00 committed by GitHub
parent e137045050
commit b4129a1591
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -31,14 +31,17 @@ export default ApplicationAdapter.extend({
mountModel = await this.ajax(this.internalURL(query.path), 'GET'); mountModel = await this.ajax(this.internalURL(query.path), 'GET');
// if kv2 then add the config data to the mountModel // if kv2 then add the config data to the mountModel
// version comes in as a string // version comes in as a string
if (mountModel.data.type === 'kv' && mountModel.data.options.version === '2') { if (mountModel?.data?.type === 'kv' && mountModel?.data?.options?.version === '2') {
configModel = await this.ajax(this.urlForConfig(query.path), 'GET'); configModel = await this.ajax(this.urlForConfig(query.path), 'GET');
mountModel.data = { ...mountModel.data, ...configModel.data }; mountModel.data = { ...mountModel.data, ...configModel.data };
} }
} catch (error) { } catch (error) {
// no path means this was an error on listing
if (!query.path) {
throw error;
}
// control groups will throw a 403 permission denied error. If this happens return the mountModel // control groups will throw a 403 permission denied error. If this happens return the mountModel
// error is handled on routing // error is handled on routing
console.log(error);
} }
return mountModel; return mountModel;
}, },