Show appropriate error message when master password is not set instead of 'Crypt key missing'. #5735
parent
66c4b9d05a
commit
ec32099d2f
|
|
@ -29,6 +29,9 @@ jobs:
|
|||
- name: Install requirements
|
||||
run: pip install -r requirements.txt
|
||||
|
||||
- name: Install pyOpenSSL
|
||||
run: pip install "pyOpenSSL>=23.*"
|
||||
|
||||
- name: Install sphinx
|
||||
run: pip install sphinx
|
||||
|
||||
|
|
|
|||
|
|
@ -56,15 +56,14 @@ export function getNodeView(nodeType, treeNodeInfo, actionType, itemNodeData, fo
|
|||
resolve(res.data);
|
||||
})
|
||||
.catch((err)=>{
|
||||
if(err.response){
|
||||
console.error('error resp', err.response);
|
||||
} else if(err.request){
|
||||
console.error('error req', err.request);
|
||||
} else if(err.message){
|
||||
console.error('error msg', err.message);
|
||||
}
|
||||
reject(err);
|
||||
Notify.pgRespErrorNotify(err);
|
||||
Notify.pgNotifier('error', err, '', function(msg) {
|
||||
if (msg == 'CRYPTKEY_SET') {
|
||||
return Promise.resolve(initData());
|
||||
} else if (msg == 'CRYPTKEY_NOT_SET') {
|
||||
reject(gettext('The master password is not set.'));
|
||||
}
|
||||
reject(err);
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -81,7 +80,14 @@ export function getNodeView(nodeType, treeNodeInfo, actionType, itemNodeData, fo
|
|||
resolve(res.data);
|
||||
onSave && onSave(res.data);
|
||||
}).catch((err)=>{
|
||||
reject(err);
|
||||
Notify.pgNotifier('error', err, '', function(msg) {
|
||||
if (msg == 'CRYPTKEY_SET') {
|
||||
return Promise.resolve(onSaveClick(isNew, data));
|
||||
} else if (msg == 'CRYPTKEY_NOT_SET') {
|
||||
reject(gettext('The master password is not set.'));
|
||||
}
|
||||
reject(err);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -595,11 +595,15 @@ function SchemaDialogView({
|
|||
});
|
||||
setFormReady(true);
|
||||
setLoaderText('');
|
||||
}).catch(()=>{
|
||||
}).catch((err)=>{
|
||||
if(unmounted) {
|
||||
return;
|
||||
}
|
||||
setLoaderText('');
|
||||
setFormErr({
|
||||
name: 'apierror',
|
||||
message: _.escape(parseApiError(err)),
|
||||
});
|
||||
});
|
||||
/* Clear the focus timeout if unmounted */
|
||||
return ()=>{
|
||||
|
|
@ -892,8 +896,9 @@ function SchemaPropertiesView({
|
|||
});
|
||||
setLoaderText('');
|
||||
}
|
||||
}).catch(()=>{
|
||||
}).catch((err)=>{
|
||||
setLoaderText('');
|
||||
Notify.pgRespErrorNotify(err);
|
||||
});
|
||||
}, []);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue