Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[WebProfilerBundle] Add HTTP return code in the Ajax request list table#17540
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
kucharovic commentedJan 26, 2016
| Q | A |
|---|---|
| Bug fix? | no |
| New feature? | yes |
| BC breaks? | no |
| Deprecations? | no |
| Tests pass? | yes |
| Fixed tickets | #17518 |
| License | MIT |
| Doc PR | - |
Q | A---|---Bug fix? | noNew feature? | yesBC breaks? | noDeprecations? | noTests pass? | yesFixed tickets |symfony#17518License | MITDoc PR | -
javiereguiluz commentedJan 26, 2016
@kucharovic I just tested your pull request and it works perfect! Thanks for working on this. However, to make errors stand out more prominently, what do you think of using the If you like the idea, the code would be something like this: varstatusCodeCell=document.createElement('td');varstatusCode=document.createElement('span');if(request.statusCode>299){statusCode.setAttribute('class','sf-toolbar-status sf-toolbar-status-red');}else{statusCode.setAttribute('class','sf-toolbar-status');}statusCode.textContent=request.statusCode||'-';statusCodeCell.appendChild(statusCode);row.appendChild(statusCodeCell); |
kucharovic commentedJan 26, 2016
@javiereguiluz it looks better. Are you sure, thatredirects should be red? |
javiereguiluz commentedJan 26, 2016
@kucharovic I trustedthis comment from@Jean85 who said that in Ajax there are no redirections. We probably need more comments about this or some verification. |
stloyd commentedJan 26, 2016
IMO it should be: if(request.statusCode<300){statusCode.setAttribute('class','sf-toolbar-status sf-toolbar-status-green');}elseif(request.statusCode<400){statusCode.setAttribute('class','sf-toolbar-status sf-toolbar-status-yellow');}else{statusCode.setAttribute('class','sf-toolbar-status sf-toolbar-status-red');} |
javiereguiluz commentedJan 26, 2016
@kucharovic anyway, to be completely safe, we could change |
kucharovic commentedJan 26, 2016
@javiereguiluzhe's right. A XMLHttpRequest should either get the resource or be told why not. |
stloyd commentedJan 26, 2016
Hmmm, then maybe: if(request.statusCode<400){statusCode.setAttribute('class','sf-toolbar-status sf-toolbar-status-green');}elseif(request.statusCode<500){statusCode.setAttribute('class','sf-toolbar-status sf-toolbar-status-yellow');}else{statusCode.setAttribute('class','sf-toolbar-status sf-toolbar-status-red');} |
javiereguiluz commentedJan 26, 2016
@stloyd I like your proposal ... except for the last comment. Showing 4xx errors in yellow is inconsistent with the current toolbar. 4xx and 5xx are treated as errors and showed in red. |
Jean85 commentedJan 26, 2016
Yeah, I posted that comment because I stumbled on it.. I had an issue in my code, since I was trying to catch redirects with I agree with@javiereguiluz , consistency with the rest of the toolbar is better. |
fabpot commentedJan 26, 2016
👍 |
stof commentedJan 26, 2016
should we really put the 2xx in green or keep it in gray instead ? I think putting colors only on errors make them stand out more than if everything is colored |
javiereguiluz commentedJan 26, 2016
fabpot commentedJan 26, 2016
+1 for gray instead of green |
maidmaid commentedJan 26, 2016
👍 |
fabpot commentedJan 27, 2016
Thank you@kucharovic. |



