Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to return exceptions - ITeamModelledRestService

Hello,

I had written a repository component in Jazz and also implemented services to get/set the data in that component. The service extends ITeamModelledRestService class.

I need to return exceptions to the client (exception code and stack trace or some descriptive message). What is the best way to do so.

Currently, the client is returned a http 500 error code and no further details.

Thanks
- Vibha

0 votes



2 answers

Permanent link
The exception is accessible at client side if you set the request header as -
Accept: text/json

The exception details are available using:
HttpURLConnection.getErrorStream

Also, seems like the exception that is thrown needs to be an instance of or subclass of TeamRepositoryException. Is this correct ?

Thanks
- Vibha

0 votes


Permanent link
I just glanced at the code, and it looks like any subclass of Exception
will be marshaled back to the caller. Did you see an exception type
that did not get sent back?

-
Matt Lavin
Jazz Server Team


On Tue, 2009-01-13 at 21:47 +0000, vssinha wrote:
The exception is accessible at client side if you set the request
header as -
Accept: text/json

The exception details are available using:
HttpURLConnection.getErrorStream

Also, seems like the exception that is thrown needs to be an instance
of or subclass of TeamRepositoryException. Is this correct ?

Thanks
- Vibha

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,927

Question asked: Jan 13 '09, 3:37 p.m.

Question was seen: 7,081 times

Last updated: Jan 13 '09, 3:37 p.m.

Confirmation Cancel Confirm