Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Add server logging for failure responses #789

Merged
merged 1 commit into from
Apr 30, 2015

Conversation

seanf
Copy link
Contributor

@seanf seanf commented Apr 30, 2015

No description provided.

@huangp
Copy link
Collaborator

huangp commented Apr 30, 2015

👍

return Response.status(Response.Status.FORBIDDEN).build();
String msg = String.format("More than %d results.", TransUnitUtils.MAX_SIZE);
log.warn(msg);
return Response.status(Response.Status.FORBIDDEN).entity(msg)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this line wrap, but not the one 2 lines above it? Weird.

@djansen-redhat
Copy link
Contributor

Any hints on how to trigger these?

@seanf
Copy link
Contributor Author

seanf commented Apr 30, 2015

Any hints on how to trigger these?

You might be able to use a custom client which sent an invalid request (too many transunit IDs), or perhaps send an illegal document for translation, but otherwise it would require a unit test with mock objects or something like Byteman which can inject exceptions: http://byteman.jboss.org/. All of which is probably overkill for such a simple change.

@djansen-redhat
Copy link
Contributor

Agreed.

seanf added a commit that referenced this pull request Apr 30, 2015
Add server logging for failure responses
@seanf seanf merged commit bb1bb59 into integration/master Apr 30, 2015
@seanf seanf deleted the logging-for-failures branch April 30, 2015 04:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants