-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue better error responses to UI (#1133)
* Do a look up for the superadmin or admin to run the queries for migration to 2.0.0 Klaw Signed-off-by: Aindriu Lavelle <[email protected]> * Initial commit for better error response handling Signed-off-by: Aindriu Lavelle <[email protected]> * Return the correct error messages Signed-off-by: Aindriu Lavelle <[email protected]> * Update to responses Signed-off-by: Aindriu Lavelle <[email protected]> * Update to responses Signed-off-by: Aindriu Lavelle <[email protected]> * Update to responses Signed-off-by: Aindriu Lavelle <[email protected]> * Update to reduce duplication Signed-off-by: Aindriu Lavelle <[email protected]> * Additional exception handling to ensure that errors do not escape Signed-off-by: Aindriu Lavelle <[email protected]> * Update to address PRs Signed-off-by: Aindriu Lavelle <[email protected]> * Update to address PRs Signed-off-by: Aindriu Lavelle <[email protected]> * Update to address PRs Signed-off-by: Aindriu Lavelle <[email protected]> * Special character introduced in error messages had to be removed. Signed-off-by: Aindriu Lavelle <[email protected]> * Special character introduced in error messages had to be removed. Signed-off-by: Aindriu Lavelle <[email protected]> * run spotless Signed-off-by: Aindriu Lavelle <[email protected]> --------- Signed-off-by: Aindriu Lavelle <[email protected]>
- Loading branch information
1 parent
4a653d0
commit 622c7bf
Showing
16 changed files
with
415 additions
and
21 deletions.
There are no files selected for viewing
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
10 changes: 10 additions & 0 deletions
10
cluster-api/src/main/java/io/aiven/klaw/clusterapi/models/error/ClusterApiErrorMessages.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package io.aiven.klaw.clusterapi.models.error; | ||
|
||
public class ClusterApiErrorMessages { | ||
|
||
public static final String CLUSTER_API_ERR_1 = "Unable to create Connector on Cluster."; | ||
|
||
public static final String CLUSTER_API_ERR_2 = "Unable to update Connector on Cluster"; | ||
|
||
public static final String CLUSTER_API_ERR_3 = "Unable To Delete Connector on Cluster."; | ||
} |
13 changes: 13 additions & 0 deletions
13
cluster-api/src/main/java/io/aiven/klaw/clusterapi/models/error/RestErrorResponse.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package io.aiven.klaw.clusterapi.models.error; | ||
|
||
import com.fasterxml.jackson.annotation.JsonAlias; | ||
import lombok.Data; | ||
|
||
@Data | ||
public class RestErrorResponse { | ||
|
||
private String message; | ||
|
||
@JsonAlias("error_code") | ||
private int errorCode; | ||
} |
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
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
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
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
13 changes: 13 additions & 0 deletions
13
core/src/main/java/io/aiven/klaw/error/RestErrorResponse.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package io.aiven.klaw.error; | ||
|
||
import com.fasterxml.jackson.annotation.JsonAlias; | ||
import lombok.Data; | ||
|
||
@Data | ||
public class RestErrorResponse { | ||
|
||
private String message; | ||
|
||
@JsonAlias({"errorCode", "error_code"}) | ||
private int errorCode; | ||
} |
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
Oops, something went wrong.