used slf4j for logging instead of exception.printStackTrace()
This commit is contained in:
parent
6fcd4d85c1
commit
13f6b1f336
@ -1,5 +1,8 @@
|
||||
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;
|
||||
|
||||
@ -10,11 +13,11 @@ import javax.ws.rs.ext.ExceptionMapper;
|
||||
* @version 1.0
|
||||
*/
|
||||
public class DefaultExceptionMapper implements ExceptionMapper<Throwable> {
|
||||
private static final Logger log = LoggerFactory.getLogger(DefaultExceptionMapper.class);
|
||||
|
||||
@Override
|
||||
public Response toResponse(Throwable exception) {
|
||||
exception.printStackTrace();
|
||||
log.error("Exception caught: ", exception);
|
||||
return Response.serverError().build();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user