Conversation
|
| dataProcessingContextApiPort.saveContext(partitionId, withReview); | ||
| }catch (GenesisException e){ | ||
| return new ResponseEntity<>(e.getMessage(), HttpStatusCode.valueOf(e.getStatus())); | ||
| return new ResponseEntity<>(e.getMessage(), e.getStatus()); |
There was a problem hiding this comment.
suggestion: utiliser le nouveau exceptionHandler
| } catch (GenesisException e) { | ||
| return ResponseEntity.status(e.getStatus()).body(e.getMessage()); | ||
| } catch (QuestionnaireNotFoundException e) { | ||
| return ResponseEntity.status(HttpStatus.NOT_FOUND).body(e.getMessage()); |
There was a problem hiding this comment.
suggestion: faire un exceptionHandler ou throw un GenesisException
| return ResponseEntity.ok("File split"); | ||
| } | ||
|
|
||
| //TODO |
| .body(exception.getMessage()); | ||
| } | ||
|
|
||
| @ExceptionHandler(QuestionnaireNotFoundException.class) |
There was a problem hiding this comment.
nitpick: créer un exceptionHandler dédié par Exception ?
There was a problem hiding this comment.
J’ai choisi de les regrouper dans un seul advice pour centraliser la gestion REST, mais je peux aussi les découper par domaine si c'est mieux
| } | ||
|
|
||
| @ExceptionHandler(NoDataException.class) | ||
| public ResponseEntity<String> handleNoData(NoDataException exception) { |
| if (!isFolderPresent(contextualFolderPath)) { | ||
| Files.createDirectories(Path.of(contextualFolderPath)); | ||
| log.debug("contextual folder created : {}", contextualFolderPath); | ||
| } else { |
There was a problem hiding this comment.
suggestion: remove else and use return;
|



No description provided.