This repository has been archived by the owner on Dec 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
ApplicationException.Code is replaced with exception classes for each of the codes. #3003
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jxu-nflx
reviewed
May 24, 2022
redis-persistence/src/main/java/com/netflix/conductor/redis/dao/RedisEventHandlerDAO.java
Show resolved
Hide resolved
jxu-nflx
reviewed
May 24, 2022
core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutor.java
Show resolved
Hide resolved
8ec7cf3
to
39bee23
Compare
…into exception_refactoring
…factoring # Conflicts: # core/src/main/java/com/netflix/conductor/core/dal/ExecutionDAOFacade.java # core/src/test/java/com/netflix/conductor/core/metadata/MetadataMapperServiceTest.java
@jxu-nflx The PR has a large footprint. It might be easier to review one commit at a time. |
jxu-nflx
reviewed
Jul 6, 2022
@@ -226,15 +236,15 @@ String toJson(Object value) { | |||
try { | |||
return objectMapper.writeValueAsString(value); | |||
} catch (JsonProcessingException e) { | |||
throw new RuntimeException(e); | |||
throw new TransientException("Error serializing to json", e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be NonTransientException instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Changed to NonTransientException
.
jxu-nflx
reviewed
Jul 6, 2022
} | ||
} | ||
|
||
<T> T readValue(String json, Class<T> clazz) { | ||
try { | ||
return objectMapper.readValue(json, clazz); | ||
} catch (IOException e) { | ||
throw new RuntimeException(e); | ||
throw new TransientException("Error serializing json", e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
jxu-nflx
approved these changes
Jul 6, 2022
dd725bc
to
a738501
Compare
a738501
to
9e1364b
Compare
pmchung
pushed a commit
to routific/conductor
that referenced
this pull request
Sep 6, 2023
ApplicationException.Code is replaced with exception classes for each of the codes.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request type
./gradlew generateLock saveLock
to refresh dependencies)Changes in this PR
Refactor
ApplicationException.Code
to their own exception classes. This makes it easier to catch and process exceptions. Previously,ApplicationException
is caught and thecatch
block contained aif-else
block for checking the codes.Code.NOT_FOUND -> NotFoundException
Code.CONFLICT -> ConflictException
Code.INVALID_INPUT -> IllegalArgumentException
Code.BACKEND_ERROR -> TransientException
Code.INTERNAL_ERROR -> NonTransientException