UNPKG

443 BJavaScriptView Raw
1'use strict';
2
3function throwProcessedException(ex, policyName) {
4
5 if (ex.code === 'Forbidden.RAM') {
6 console.error(`\n${ex.message}`);
7 throw new Error(`\nMaybe you need grant ${policyName} policy to the sub-account or use the primary account.\nIf you don’t want use the ${policyName} policy or primary account, you can also specify the Role property for Service.`);
8 }
9 throw ex;
10}
11
12module.exports = { throwProcessedException };
\No newline at end of file