Bug 1055790

Summary: Unhelpful error code returned for incorrect html type
Product: [Retired] Zanata Reporter: Damian Jansen <djansen>
Component: Component-APIAssignee: Patrick Huang <pahuang>
Status: CLOSED CURRENTRELEASE QA Contact: Zanata-QA Mailling List <zanata-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.2CC: dchen, pahuang, zanata-bugs
Target Milestone: ---   
Target Release: 3.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 3.3.0-SNAPSHOT (20140121-1355) Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-03-20 05:47:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Damian Jansen 2014-01-20 23:17:23 UTC
Description of problem:
When attempting to use the rest api via a browser (which sends in the header a type of text/html) an error 500 is returned. It would be more appropriate if the error indicated "incorrect mime type" or similar.

Version-Release number of selected component (if applicable):
3.2.0

How reproducible:
Easy always

Steps to Reproduce:
1. Navigate a browser to https://translate.zanata.org/zanata/rest/projects
2. Note the error 500
3. In a console enter 
 > curl https://translate.zanata.org/zanata/rest/projects
4. Note the successful xml list

Actual results:
On entering the url into a browser, an error "500 Error processing Request" is displayed, and logging shows
> Failed to process REST request: java.lang.IllegalArgumentException: Failure parsing MediaType string: text/html,application/xhtml+xml,application/xml

Expected results:
Something a bit more user friendly.

Additional info:

Comment 1 Patrick Huang 2014-01-21 00:26:40 UTC
https://github.com/zanata/zanata-server/pull/343

Comment 2 Damian Jansen 2014-01-21 04:22:20 UTC
Verified at 7c59e4ccb46504bee75cc04c1dfd217648e3d4ef

Comment 3 Sean Flanigan 2014-03-20 05:47:12 UTC
Closing VERIFIED bugs for Zanata server 3.3.2.