Example usage for org.apache.commons.logging Log error

List of usage examples for org.apache.commons.logging Log error

Introduction

In this page you can find the example usage for org.apache.commons.logging Log error.

Prototype

void error(Object message, Throwable t);

Source Link

Document

Logs an error with error log level.

Usage

From source file:org.swordess.ldap.util.LogUtils.java

public static void error(Log log, Object message, Throwable t) {
    if (log.isErrorEnabled()) {
        log.error(message, t);
    }//from ww  w .jav  a  2 s  .  c o  m
}

From source file:org.wso2.carbon.apimgt.rest.api.util.utils.RestApiUtil.java

/**
 * Logs the error, builds a ForbiddenException with specified details and throws it
 * /*from   www.  j a  v a 2  s. com*/
 * @param resource Resource type
 * @param id id of resource
 * @param t Throwable
 * @param log Log instance
 * @throws ForbiddenException
 */
public static void handleAuthorizationFailure(String resource, String id, Throwable t, Log log)
        throws ForbiddenException {
    ForbiddenException forbiddenException = buildForbiddenException(resource, id);
    log.error(forbiddenException.getMessage(), t);
    throw forbiddenException;
}

From source file:org.wso2.carbon.apimgt.rest.api.util.utils.RestApiUtil.java

/**
 * Logs the error, builds a ForbiddenException with specified details and throws it
 * //from  w w w.  jav  a 2s  .c o  m
 * @param description description of the error
 * @param t Throwable instance
 * @param log Log instance
 * @throws ForbiddenException
 */
public static void handleAuthorizationFailure(String description, Throwable t, Log log)
        throws ForbiddenException {
    ForbiddenException forbiddenException = buildForbiddenException(description);
    log.error(description, t);
    throw forbiddenException;
}

From source file:org.wso2.carbon.apimgt.rest.api.util.utils.RestApiUtil.java

/**
 * Logs the error, builds a NotFoundException with specified details and throws it
 * /*from  w  w  w .  j a  v a2 s.  c o m*/
 * @param resource requested resource
 * @param id id of resource
 * @param t Throwable instance
 * @param log Log instance
 * @throws NotFoundException
 */
public static void handleResourceNotFoundError(String resource, String id, Throwable t, Log log)
        throws NotFoundException {
    NotFoundException notFoundException = buildNotFoundException(resource, id);
    log.error(notFoundException.getMessage(), t);
    throw notFoundException;
}

From source file:org.wso2.carbon.apimgt.rest.api.util.utils.RestApiUtil.java

/**
 * Logs the error, builds a NotFoundException with specified details and throws it
 *
 * @param description description of the error
 * @param t Throwable instance/*from  ww w.  j  av  a  2 s  .  com*/
 * @param log Log instance
 * @throws NotFoundException
 */
public static void handleResourceNotFoundError(String description, Throwable t, Log log)
        throws NotFoundException {
    NotFoundException notFoundException = buildNotFoundException(description);
    log.error(description, t);
    throw notFoundException;
}

From source file:org.wso2.carbon.apimgt.rest.api.util.utils.RestApiUtil.java

/**
 * Logs the error, builds a ConflictException with specified details and throws it
 * //from  w w w  .  j  av  a  2s.  c  om
 * @param description description of the error
 * @param t Throwable instance
 * @param log Log instance
 * @throws ConflictException
 */
public static void handleResourceAlreadyExistsError(String description, Throwable t, Log log)
        throws ConflictException {
    ConflictException conflictException = buildConflictException(
            RestApiConstants.STATUS_CONFLICT_MESSAGE_RESOURCE_ALREADY_EXISTS, description);
    log.error(description, t);
    throw conflictException;
}

From source file:org.wso2.carbon.apimgt.rest.api.util.utils.RestApiUtil.java

/**
 * Logs the error, builds a internalServerErrorException with specified details and throws it
 * //ww  w.  j a va2s .  co  m
 * @param msg error message
 * @param t Throwable instance
 * @param log Log instance
 * @throws InternalServerErrorException
 */
public static void handleInternalServerError(String msg, Throwable t, Log log)
        throws InternalServerErrorException {
    InternalServerErrorException internalServerErrorException = buildInternalServerErrorException();
    log.error(msg, t);
    throw internalServerErrorException;
}

From source file:org.wso2.carbon.application.deployer.synapse.SynapseAppDeployer.java

private void handleException(Log log, String message, Exception e) throws AxisFault {

    if (e == null) {

        AxisFault exception = new AxisFault(message);
        log.error(message, exception);
        throw exception;

    } else {/*from   ww  w  . ja v  a  2s  . c  o  m*/
        message = message + " :: " + e.getMessage();
        log.error(message, e);
        throw new AxisFault(message, e);
    }
}