|
|
|
@ -32,6 +32,7 @@ import org.springframework.security.core.Authentication; |
|
|
|
import org.springframework.security.core.context.SecurityContextHolder; |
|
|
|
import org.springframework.web.bind.MethodArgumentNotValidException; |
|
|
|
import org.springframework.web.bind.annotation.ExceptionHandler; |
|
|
|
import org.springframework.web.context.request.async.AsyncRequestTimeoutException; |
|
|
|
import org.springframework.web.context.request.async.DeferredResult; |
|
|
|
import org.thingsboard.server.cluster.TbClusterService; |
|
|
|
import org.thingsboard.server.common.data.Customer; |
|
|
|
@ -346,6 +347,8 @@ public abstract class BaseController { |
|
|
|
return new ThingsboardException(exception.getMessage(), ThingsboardErrorCode.BAD_REQUEST_PARAMS); |
|
|
|
} else if (exception instanceof MessagingException) { |
|
|
|
return new ThingsboardException("Unable to send mail: " + exception.getMessage(), ThingsboardErrorCode.GENERAL); |
|
|
|
} else if (exception instanceof AsyncRequestTimeoutException) { |
|
|
|
return new ThingsboardException("Request timeout", ThingsboardErrorCode.GENERAL); |
|
|
|
} else { |
|
|
|
return new ThingsboardException(exception.getMessage(), exception, ThingsboardErrorCode.GENERAL); |
|
|
|
} |
|
|
|
|