Skip to content

Commit

Permalink
Added UnprocessableEntityException (for 422 status code).
Browse files Browse the repository at this point in the history
  • Loading branch information
tfredrich committed Jan 15, 2016
1 parent 22bfb40 commit e42ca05
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -84,6 +84,7 @@ Release 0.11.3-SNAPSHOT in branch 'master'
* Issue #125 - Changed DefaultExceptionMapper to map cause for RuntimeException (not sub-classes) so all exceptions get mapped correctly from the mapping settings. Left a version, LegacyExceptionMapper, for old behavior. If you want legacy behavior, simply call server.setExceptionMapping(new LegacyExceptionMapper());
* Upgraded to jackson-databind 2.6.0 (from 2.4.2).
* Minor fixes due to FindBugs report. There were 11 easily fixable issues reported by FindBugs: primarily equals(), hashCode() and compareTo() implementations.
* Added UnprocessableEntityException (for 422 status code).

Release 0.11.2 - 26 Jul 2015
----------------------------
Expand Down
@@ -0,0 +1,51 @@
/*
Copyright 2016, Strategic Gains, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package org.restexpress.exception;

import io.netty.handler.codec.http.HttpResponseStatus;

/**
* Represents a 422 response code (Unprocessable Entity).
*
* @author toddf
* @since Jan 15, 2016
*/
public class UnprocessableEntityException
extends ServiceException
{
private static final long serialVersionUID = 3297576608239532992L;
private static final HttpResponseStatus STATUS = HttpResponseStatus.UNPROCESSABLE_ENTITY;

public UnprocessableEntityException()
{
super(STATUS);
}

public UnprocessableEntityException(String message)
{
super(STATUS, message);
}

public UnprocessableEntityException(Throwable cause)
{
super(STATUS, cause);
}

public UnprocessableEntityException(String message, Throwable cause)
{
super(STATUS, message, cause);
}
}

0 comments on commit e42ca05

Please sign in to comment.