Better error handling
This commit is contained in:
parent
6cb863005d
commit
979e5754a5
@ -75,6 +75,9 @@ function error($message, $priority = true, $debug_stuff = false) {
|
||||
$debug_stuff = array_combine(array('SQLSTATE', 'Error code', 'Error message'), $db_error);
|
||||
}
|
||||
|
||||
// Return the bad request header, necessary for AJAX posts
|
||||
http_response_code(400);
|
||||
|
||||
die(Element('page.html', array(
|
||||
'config' => $config,
|
||||
'title' => _('Error'),
|
||||
|
@ -254,10 +254,9 @@ $("form[name='post']").on("submit", function(e){
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(data) {
|
||||
//location.reload();
|
||||
console.log(data);
|
||||
location.reload();
|
||||
},
|
||||
error: function(data) {alert("Something went wrong!"); console.log(data)}
|
||||
error: function(jq, data) {alert($('h2',jq.responseText).text());}
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user