mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-20 12:58:46 +01:00
Register a JSON handler to show error responses as error message instead of losing them.
This commit is contained in:
parent
551dff28e3
commit
bad65780bc
@ -29,6 +29,16 @@ egw.extend('message', egw.MODULE_WND_LOCAL, function(_app, _wnd)
|
|||||||
var error_reg_exp;
|
var error_reg_exp;
|
||||||
var on_click_remove_installed = false;
|
var on_click_remove_installed = false;
|
||||||
|
|
||||||
|
// Register an 'error' plugin, displaying using the message system
|
||||||
|
this.registerJSONPlugin(function(type, res, req) {
|
||||||
|
if (typeof res.data == 'string')
|
||||||
|
{
|
||||||
|
egw.message(res.data,'error');
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
throw 'Invalid parameters';
|
||||||
|
}, null, 'error');
|
||||||
|
|
||||||
return {
|
return {
|
||||||
/**
|
/**
|
||||||
* Display an error or regular message
|
* Display an error or regular message
|
||||||
|
Loading…
Reference in New Issue
Block a user