All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.telegram.telegrambots.updatesreceivers.DefaultExceptionMapper Maven / Gradle / Ivy

There is a newer version: 6.9.7.1
Show newest version
package org.telegram.telegrambots.updatesreceivers;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;

/**
 * Prints exceptions in webhook bots to stderr
 *
 * @author Mouamle
 * @version 1.0
 */
public class DefaultExceptionMapper implements ExceptionMapper {
    private static final Logger log = LoggerFactory.getLogger(DefaultExceptionMapper.class);

    @Override
    public Response toResponse(Throwable exception) {
        log.error("Exception caught: ", exception);
        return Response.serverError().build();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy