Package org.sf.bee.commons.exception.impl

Examples of org.sf.bee.commons.exception.impl.StandardCodedException


        final String message = ExceptionUtils.getRealMessage(t);
        return this.getError500(message);
    }

    private StandardCodedException getError500(final String message) {
        return new StandardCodedException(
                StandardCodedException.ERROR_500_SERVERERROR,
                message);
    }
View Full Code Here


                StandardCodedException.ERROR_500_SERVERERROR,
                message);
    }

    private StandardCodedException getError503(final String message) {
        return new StandardCodedException(
                StandardCodedException.ERROR_503_SERVICEUNAVAILABLE,
                message);
    }
View Full Code Here

                StandardCodedException.ERROR_503_SERVICEUNAVAILABLE,
                message);
    }

    private StandardCodedException getError403() {
        return new StandardCodedException(
                StandardCodedException.ERROR_403_FORBIDDEN,
                "Invalid Username or Password");
    }
View Full Code Here

        return LoggingUtils.getLogger(this);
    }

    private void doOnError(final Throwable t) {
        if (null != _eventListener) {
            final StandardCodedException ex = new StandardCodedException(
                    StandardCodedException.ERROR_500_SERVERERROR, t);
            final BeeEvent event = new BeeEvent(this, BeeEvents.ON_ERROR, ex);
            _eventListener.onEvent(event);
        }
    }
View Full Code Here

        final String message = ExceptionUtils.getRealMessage(t);
        return this.getError500(message);
    }

    private StandardCodedException getError500(final String message) {
        return new StandardCodedException(
                StandardCodedException.ERROR_500_SERVERERROR,
                message);
    }
View Full Code Here

                StandardCodedException.ERROR_500_SERVERERROR,
                message);
    }

    private StandardCodedException getError418(final String message) {
        return new StandardCodedException(
                StandardCodedException.ERROR_418_IAMTEAPOT,
                message);
    }
View Full Code Here

        return ExceptionUtils.getRealMessage(_exception);
    }

    public String getExceptionCode() {
        if(_exception instanceof StandardCodedException){
            final StandardCodedException sce = (StandardCodedException)_exception;
            return sce.getCode();
        }
        return "";
    }
View Full Code Here

            throw ex;
        } catch (IOException e) {
            final String message = StringUtils.format(
                    "Fatal protocol violation: %s", e.getMessage());
            final Exception ex = new Exception(message,
                    new StandardCodedException(
                    StandardCodedException.ERROR_401_CONNREFUSED, e));
            throw ex;
        } catch(Throwable t){
            final String message = StringUtils.format(
                    "Generic Exception: %s", t.getMessage());
View Full Code Here

    }

    public StandardCodedException asException() {
        if (isError()) {
            final String cause = _jsonobject.optString(TAG_CAUSE, null);
            final StandardCodedException result = new StandardCodedException();
            result.setMessage(this.getTagValue());
            if (StringUtils.hasText(cause)) {
                result.setCause(new Exception(cause));
            }
            return result;
        } else {
            return null;
        }
View Full Code Here

TOP

Related Classes of org.sf.bee.commons.exception.impl.StandardCodedException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.