@@ -192,9 +192,15 @@ public class ApiController {
|
|||||||
|
|
||||||
return ResponseEntity.ok(response);
|
return ResponseEntity.ok(response);
|
||||||
|
|
||||||
|
} catch(IllegalArgumentException e) {
|
||||||
|
log.error("Error with file extensions : {}", e.getMessage(), e);
|
||||||
|
return ResponseEntity.ok().body(new BaseResponse(MessageCode.FILE_FOR_SEARCH_NOT_VALID.getCode(),
|
||||||
|
MessageCode.FILE_FOR_SEARCH_NOT_VALID.getCode(),
|
||||||
|
MessageCode.FILE_FOR_SEARCH_NOT_VALID.getDescription(), null));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Error finding similar files: {}", e.getMessage(), e);
|
log.error("Error finding similar files: {}", e.getMessage(), e);
|
||||||
return ResponseEntity.ok().body(new BaseResponse(0, MessageCode.INVALID_FIELD.getCode(),
|
return ResponseEntity.ok().body(new BaseResponse(MessageCode.INVALID_FIELD.getCode(),
|
||||||
|
MessageCode.INVALID_FIELD.getCode(),
|
||||||
MessageCode.INVALID_FIELD.getDescription(), null));
|
MessageCode.INVALID_FIELD.getDescription(), null));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ public enum MessageCode {
|
|||||||
COMPANY_ALREADY_EXISTS(2, "Company already exists"),
|
COMPANY_ALREADY_EXISTS(2, "Company already exists"),
|
||||||
USER_LIMIT_IS_OVER(2, "Over user limits"),
|
USER_LIMIT_IS_OVER(2, "Over user limits"),
|
||||||
ERROR_TARIFF_INFO(2, "Erorr with tariff info"),
|
ERROR_TARIFF_INFO(2, "Erorr with tariff info"),
|
||||||
|
FILE_FOR_SEARCH_NOT_VALID(2, "File for search unsupported"),
|
||||||
USER_NOT_ACTIVE(2, "User not active");
|
USER_NOT_ACTIVE(2, "User not active");
|
||||||
|
|
||||||
private final Integer code;
|
private final Integer code;
|
||||||
|
|||||||
Reference in New Issue
Block a user