|
shun-iwasawa |
82a8f5 |
/*
|
|
shun-iwasawa |
82a8f5 |
* Copyright (C)2015 Viktor Szathmรกry. All Rights Reserved.
|
|
shun-iwasawa |
82a8f5 |
* Copyright (C)2017-2018 D. R. Commander. All Rights Reserved.
|
|
shun-iwasawa |
82a8f5 |
*
|
|
shun-iwasawa |
82a8f5 |
* Redistribution and use in source and binary forms, with or without
|
|
shun-iwasawa |
82a8f5 |
* modification, are permitted provided that the following conditions are met:
|
|
shun-iwasawa |
82a8f5 |
*
|
|
shun-iwasawa |
82a8f5 |
* - Redistributions of source code must retain the above copyright notice,
|
|
shun-iwasawa |
82a8f5 |
* this list of conditions and the following disclaimer.
|
|
shun-iwasawa |
82a8f5 |
* - Redistributions in binary form must reproduce the above copyright notice,
|
|
shun-iwasawa |
82a8f5 |
* this list of conditions and the following disclaimer in the documentation
|
|
shun-iwasawa |
82a8f5 |
* and/or other materials provided with the distribution.
|
|
shun-iwasawa |
82a8f5 |
* - Neither the name of the libjpeg-turbo Project nor the names of its
|
|
shun-iwasawa |
82a8f5 |
* contributors may be used to endorse or promote products derived from this
|
|
shun-iwasawa |
82a8f5 |
* software without specific prior written permission.
|
|
shun-iwasawa |
82a8f5 |
*
|
|
shun-iwasawa |
82a8f5 |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS",
|
|
shun-iwasawa |
82a8f5 |
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
shun-iwasawa |
82a8f5 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
shun-iwasawa |
82a8f5 |
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
|
|
shun-iwasawa |
82a8f5 |
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
shun-iwasawa |
82a8f5 |
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
shun-iwasawa |
82a8f5 |
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
shun-iwasawa |
82a8f5 |
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
shun-iwasawa |
82a8f5 |
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
shun-iwasawa |
82a8f5 |
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
shun-iwasawa |
82a8f5 |
* POSSIBILITY OF SUCH DAMAGE.
|
|
shun-iwasawa |
82a8f5 |
*/
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
package org.libjpegturbo.turbojpeg;
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
import java.io.IOException;
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
@SuppressWarnings("checkstyle:JavadocType")
|
|
shun-iwasawa |
82a8f5 |
public class TJException extends IOException {
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
private static final long serialVersionUID = 1L;
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
@SuppressWarnings("checkstyle:JavadocMethod")
|
|
shun-iwasawa |
82a8f5 |
public TJException() {
|
|
shun-iwasawa |
82a8f5 |
super();
|
|
shun-iwasawa |
82a8f5 |
}
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
@SuppressWarnings("checkstyle:JavadocMethod")
|
|
shun-iwasawa |
82a8f5 |
public TJException(String message, Throwable cause) {
|
|
shun-iwasawa |
82a8f5 |
super(message, cause);
|
|
shun-iwasawa |
82a8f5 |
}
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
@SuppressWarnings("checkstyle:JavadocMethod")
|
|
shun-iwasawa |
82a8f5 |
public TJException(String message) {
|
|
shun-iwasawa |
82a8f5 |
super(message);
|
|
shun-iwasawa |
82a8f5 |
}
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
@SuppressWarnings("checkstyle:JavadocMethod")
|
|
shun-iwasawa |
82a8f5 |
public TJException(String message, int code) {
|
|
shun-iwasawa |
82a8f5 |
super(message);
|
|
shun-iwasawa |
82a8f5 |
if (errorCode >= 0 && errorCode < TJ.NUMERR)
|
|
shun-iwasawa |
82a8f5 |
errorCode = code;
|
|
shun-iwasawa |
82a8f5 |
}
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
@SuppressWarnings("checkstyle:JavadocMethod")
|
|
shun-iwasawa |
82a8f5 |
public TJException(Throwable cause) {
|
|
shun-iwasawa |
82a8f5 |
super(cause);
|
|
shun-iwasawa |
82a8f5 |
}
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
/**
|
|
shun-iwasawa |
82a8f5 |
* Returns a code (one of {@link TJ TJ.ERR_*}) indicating the severity of the
|
|
shun-iwasawa |
82a8f5 |
* last error.
|
|
shun-iwasawa |
82a8f5 |
*
|
|
shun-iwasawa |
82a8f5 |
* @return a code (one of {@link TJ TJ.ERR_*}) indicating the severity of the
|
|
shun-iwasawa |
82a8f5 |
* last error.
|
|
shun-iwasawa |
82a8f5 |
*/
|
|
shun-iwasawa |
82a8f5 |
public int getErrorCode() {
|
|
shun-iwasawa |
82a8f5 |
return errorCode;
|
|
shun-iwasawa |
82a8f5 |
}
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
private int errorCode = TJ.ERR_FATAL;
|
|
shun-iwasawa |
82a8f5 |
}
|