You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would probably be best to call w.WriteHeader(http.StatusInternalServerError).
This issue affected me in a AJAX handler that triggered the success callback on a compilation error with the HTML as a string rather than the decoded JSON object I was expecting.
Furthermore, it would be nicer if the error response also respected the Accept HTTP header. For example, if Accept equals "application/json":
{"Error": "Go Compilation Error",// Equal to the title of the html page."Message": "The Go code %s does not compile: %s",// Equal to the content of .header p"File": {"File": "%s (around line %d)",// Equal to .source h2"Line": "%s",// Equal to the highlighted code block rendered in .source}}
The text was updated successfully, but these errors were encountered:
When Harness responds with a compilation error, it generates the page with 200 OK.
https://github.com/revel/cmd/blob/master/harness/harness.go#L137
It would probably be best to call
w.WriteHeader(http.StatusInternalServerError)
.This issue affected me in a AJAX handler that triggered the success callback on a compilation error with the HTML as a string rather than the decoded JSON object I was expecting.
Furthermore, it would be nicer if the error response also respected the Accept HTTP header. For example, if Accept equals "application/json":
The text was updated successfully, but these errors were encountered: