-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added JS exception dialog for failed ajax calls #5273
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<div id="{dialog_name}" title="{title}"> | ||
<div><span class="label">Error: </span><span class="value">{message}</span></div> | ||
<div class="connection"> | ||
<div><span class="label">URL: </span><span class="value">{url}</span></div> | ||
<div><span class="label">Data: </span><span class="value">{data}</span></div> | ||
</div> | ||
<div class="hint"><span class="label">Hint: </span><span class="value">{hint}</span></div> | ||
<div class="stack"> | ||
<div class="label">Stack: </div> | ||
<pre class="value">{stack}</pre> | ||
</ul> | ||
</div> | ||
</div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,5 +33,10 @@ | |
//show the user a detailed error page | ||
\OCP\Util::writeLog('index', $ex->getMessage(), \OCP\Util::FATAL); | ||
OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR); | ||
OC_Template::printExceptionErrorPage($ex); | ||
if (strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest'){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmmm - I would have checked for the Accept header There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea, assuming that all browsers send it consistently There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like jquery doesn't automatically send it. I'll need to find a way to set it globally for all ajax calls without too much hacking. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
sometimes I'm really thinking about switching the job ....
yes - leave it the way it is |
||
OC_Template::printExceptionJson($ex); | ||
} | ||
else{ | ||
OC_Template::printExceptionErrorPage($ex); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing translation of Error and below Data and Stack.