instrumented client error handling to use new framework
parent
8749e1124e
commit
d79bbaf430
|
@ -286,15 +286,7 @@ var ClientView = Backbone.View.extend({
|
||||||
console.log('token:' + token.get('value'));
|
console.log('token:' + token.get('value'));
|
||||||
$('#modalAlert .modal-body #registrationToken').val(token.get('value'));
|
$('#modalAlert .modal-body #registrationToken').val(token.get('value'));
|
||||||
},
|
},
|
||||||
error: function() {
|
error: app.errorHandlerView.handleError({message: $.t('client.client-form.rotate-registration-token-error')})
|
||||||
$('#modalAlert').i18n();
|
|
||||||
$('#modalAlert .modal-body').html($t('client.client-form.rotate-registration-token-error'));
|
|
||||||
$('#modalAlert').modal({
|
|
||||||
'backdrop': 'static',
|
|
||||||
'keyboard': true,
|
|
||||||
'show': true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -307,16 +299,7 @@ var ClientView = Backbone.View.extend({
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
error:function() {
|
error:app.errorHandlerView.handleError({log: "An error occurred when fetching the registration token", message: $.t('client.client-form.registration-token-error')})
|
||||||
$('#modalAlert').i18n();
|
|
||||||
$('#modalAlert .modal-body').html($t('client.client-form.registration-token-error'));
|
|
||||||
$('#modalAlert').modal({
|
|
||||||
'backdrop': 'static',
|
|
||||||
'keyboard': true,
|
|
||||||
'show': true
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -374,22 +357,7 @@ var ClientView = Backbone.View.extend({
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
error:function (error, response) {
|
error:app.errorHandlerView.handleError({log: "An error occurred when deleting a client"})
|
||||||
console.log("An error occurred when deleting a client");
|
|
||||||
|
|
||||||
//Pull out the response text.
|
|
||||||
var responseJson = JSON.parse(response.responseText);
|
|
||||||
|
|
||||||
//Display an alert with an error message
|
|
||||||
$('#modalAlert div.modal-header').html(responseJson.error);
|
|
||||||
$('#modalAlert div.modal-body').html(responseJson.error_description);
|
|
||||||
|
|
||||||
$("#modalAlert").modal({ // wire up the actual modal functionality and show the dialog
|
|
||||||
"backdrop" : "static",
|
|
||||||
"keyboard" : true,
|
|
||||||
"show" : true // ensure the modal is shown immediately
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
_self.parentView.delegateEvents();
|
_self.parentView.delegateEvents();
|
||||||
|
@ -453,10 +421,10 @@ var ClientListView = Backbone.View.extend({
|
||||||
'<span class="label" id="loading-stats">' + $.t("common.statistics") + '</span> '
|
'<span class="label" id="loading-stats">' + $.t("common.statistics") + '</span> '
|
||||||
);
|
);
|
||||||
|
|
||||||
$.when(this.model.fetchIfNeeded({success:function(e) {$('#loading-clients').addClass('label-success');}}),
|
$.when(this.model.fetchIfNeeded({success:function(e) {$('#loading-clients').addClass('label-success');}, error:app.errorHandlerView.handleError()}),
|
||||||
this.options.whiteListList.fetchIfNeeded({success:function(e) {$('#loading-whitelist').addClass('label-success');}}),
|
this.options.whiteListList.fetchIfNeeded({success:function(e) {$('#loading-whitelist').addClass('label-success');}, error:app.errorHandlerView.handleError()}),
|
||||||
this.options.stats.fetchIfNeeded({success:function(e) {$('#loading-stats').addClass('label-success');}}),
|
this.options.stats.fetchIfNeeded({success:function(e) {$('#loading-stats').addClass('label-success');}, error:app.errorHandlerView.handleError()}),
|
||||||
this.options.systemScopeList.fetchIfNeeded({success:function(e) {$('#loading-scopes').addClass('label-success');}}))
|
this.options.systemScopeList.fetchIfNeeded({success:function(e) {$('#loading-scopes').addClass('label-success');}, error:app.errorHandlerView.handleError()}))
|
||||||
.done(function() {
|
.done(function() {
|
||||||
$('#loadingbox').sheet('hide');
|
$('#loadingbox').sheet('hide');
|
||||||
callback();
|
callback();
|
||||||
|
@ -567,10 +535,10 @@ var ClientListView = Backbone.View.extend({
|
||||||
);
|
);
|
||||||
|
|
||||||
var _self = this;
|
var _self = this;
|
||||||
$.when(this.model.fetch({success:function(e) {$('#loading-clients').addClass('label-success');}}),
|
$.when(this.model.fetch({success:function(e) {$('#loading-clients').addClass('label-success');}, error:app.errorHandlerView.handleError()}),
|
||||||
this.options.whiteListList.fetch({success:function(e) {$('#loading-whitelist').addClass('label-success');}}),
|
this.options.whiteListList.fetch({success:function(e) {$('#loading-whitelist').addClass('label-success');}, error:app.errorHandlerView.handleError()}),
|
||||||
this.options.stats.fetch({success:function(e) {$('#loading-stats').addClass('label-success');}}),
|
this.options.stats.fetch({success:function(e) {$('#loading-stats').addClass('label-success');}, error:app.errorHandlerView.handleError()}),
|
||||||
this.options.systemScopeList.fetch({success:function(e) {$('#loading-scopes').addClass('label-success');}}))
|
this.options.systemScopeList.fetch({success:function(e) {$('#loading-scopes').addClass('label-success');}, error:app.errorHandlerView.handleError()}))
|
||||||
.done(function() {
|
.done(function() {
|
||||||
$('#loadingbox').sheet('hide');
|
$('#loadingbox').sheet('hide');
|
||||||
_self.render();
|
_self.render();
|
||||||
|
@ -667,8 +635,8 @@ var ClientFormView = Backbone.View.extend({
|
||||||
'<span class="label" id="loading-scopes">' + $.t("common.scopes") + '</span> '
|
'<span class="label" id="loading-scopes">' + $.t("common.scopes") + '</span> '
|
||||||
);
|
);
|
||||||
|
|
||||||
$.when(this.options.systemScopeList.fetchIfNeeded({success:function(e) {$('#loading-scopes').addClass('label-success');}}),
|
$.when(this.options.systemScopeList.fetchIfNeeded({success:function(e) {$('#loading-scopes').addClass('label-success');}, error:app.errorHandlerView.handleError()}),
|
||||||
this.model.fetchIfNeeded({success:function(e) {$('#loading-clients').addClass('label-success');}}))
|
this.model.fetchIfNeeded({success:function(e) {$('#loading-clients').addClass('label-success');}, error:app.errorHandlerView.handleError()}))
|
||||||
.done(function() {
|
.done(function() {
|
||||||
$('#loadingbox').sheet('hide');
|
$('#loadingbox').sheet('hide');
|
||||||
callback();
|
callback();
|
||||||
|
@ -917,15 +885,7 @@ var ClientFormView = Backbone.View.extend({
|
||||||
var sectorIdentifierUri = $('#sectorIdentifierUri input').val();
|
var sectorIdentifierUri = $('#sectorIdentifierUri input').val();
|
||||||
if (subjectType == 'PAIRWISE' && redirectUris.length > 1 && sectorIdentifierUri == '') {
|
if (subjectType == 'PAIRWISE' && redirectUris.length > 1 && sectorIdentifierUri == '') {
|
||||||
//Display an alert with an error message
|
//Display an alert with an error message
|
||||||
$('#modalAlert div.modal-header').html("Consistency error");
|
app.errorHandlerView.showErrorMessage($.t("client.client-form.error.consistency"), $.t("client.client-form.error.pairwise-sector"));
|
||||||
$('#modalAlert div.modal-body').html("Pairwise identifiers cannot be used with multiple redirect URIs unless a sector identifier URI is also registered.");
|
|
||||||
|
|
||||||
$("#modalAlert").modal({ // wire up the actual modal functionality and show the dialog
|
|
||||||
"backdrop" : "static",
|
|
||||||
"keyboard" : true,
|
|
||||||
"show" : true // ensure the modal is shown immediately
|
|
||||||
});
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -944,17 +904,7 @@ var ClientFormView = Backbone.View.extend({
|
||||||
jwks = JSON.parse($('#jwks textarea').val());
|
jwks = JSON.parse($('#jwks textarea').val());
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log("An error occurred when parsing the JWK Set");
|
console.log("An error occurred when parsing the JWK Set");
|
||||||
|
app.errorHandlerView.showErrorMessage($.t("client.client-form.error.jwk-set"), $.t("client.client-form.error.jwk-set-parse"));
|
||||||
//Display an alert with an error message
|
|
||||||
$('#modalAlert div.modal-header').html("JWK Set Error");
|
|
||||||
$('#modalAlert div.modal-body').html("There was an error parsing the public key from the JSON Web Key set. Check the value and try again.");
|
|
||||||
|
|
||||||
$("#modalAlert").modal({ // wire up the actual modal functionality and show the dialog
|
|
||||||
"backdrop" : "static",
|
|
||||||
"keyboard" : true,
|
|
||||||
"show" : true // ensure the modal is shown immediately
|
|
||||||
});
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -169,7 +169,13 @@
|
||||||
"unknown": "(Unknown)",
|
"unknown": "(Unknown)",
|
||||||
"user-info-crypto-algorithm": "User Info Endpoint Encryption Algorithm",
|
"user-info-crypto-algorithm": "User Info Endpoint Encryption Algorithm",
|
||||||
"user-info-crypto-method": "User Info Endpoint Encryption Method",
|
"user-info-crypto-method": "User Info Endpoint Encryption Method",
|
||||||
"user-info-signing-algorithm": "User Info Endpoint Signing Algorithm"
|
"user-info-signing-algorithm": "User Info Endpoint Signing Algorithm",
|
||||||
|
"error": {
|
||||||
|
"consistency": "Consistency error",
|
||||||
|
"pairwise-sector": "Pairwise identifiers cannot be used with multiple redirect URIs unless a sector identifier URI is also registered.",
|
||||||
|
"jwk-set": "JWK set error",
|
||||||
|
"jwk-set-parse": "There was an error parsing the public key from the JSON Web Key set. Check the value and try again."
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"client-table": {
|
"client-table": {
|
||||||
"allow-introspection-tooltip": "This client can perform token introspection",
|
"allow-introspection-tooltip": "This client can perform token introspection",
|
||||||
|
@ -470,7 +476,10 @@
|
||||||
"title": "Error",
|
"title": "Error",
|
||||||
"header": "Error",
|
"header": "Error",
|
||||||
"header-with-message": "Error: ",
|
"header-with-message": "Error: ",
|
||||||
"message": "There was an error in the application: "
|
"reload": "Additionally, it looks like you're not logged in. Reload the page to try again. You will likely lose any unsaved work.",
|
||||||
|
"reload-button": "Reload",
|
||||||
|
"message": "There was an error processing your request.",
|
||||||
|
"server-message": "The server said: "
|
||||||
},
|
},
|
||||||
"login": {
|
"login": {
|
||||||
"login_with_username_and_password": "Login with Username and Password",
|
"login_with_username_and_password": "Login with Username and Password",
|
||||||
|
|
Loading…
Reference in New Issue