-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MINOR - Prepare App Instances & fix bigtable json (#15292)
* MINOR - Prepare App Exception & fix bigtable json * Do not init the app all the time and allow to fetch initialized resources * init installed apps * Add runtime props * Add runtime props * Format
- Loading branch information
Showing
5 changed files
with
83 additions
and
12 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
openmetadata-service/src/main/java/org/openmetadata/service/apps/AppException.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,32 @@ | ||
package org.openmetadata.service.apps; | ||
|
||
import javax.ws.rs.core.Response; | ||
import org.openmetadata.sdk.exception.WebServiceException; | ||
|
||
public class AppException extends WebServiceException { | ||
|
||
private static final String BY_NAME_MESSAGE = "Application [%s] Exception [%s] due to [%s]."; | ||
private static final String ERROR_TYPE = "PIPELINE_SERVICE_ERROR"; | ||
|
||
public AppException(String message) { | ||
super(Response.Status.BAD_REQUEST, ERROR_TYPE, message); | ||
} | ||
|
||
private AppException(Response.Status status, String message) { | ||
super(status, ERROR_TYPE, message); | ||
} | ||
|
||
public static AppException byMessage( | ||
String appName, String name, String errorMessage, Response.Status status) { | ||
return new AppException(status, buildMessageByName(appName, name, errorMessage)); | ||
} | ||
|
||
public static AppException byMessage(String appName, String name, String errorMessage) { | ||
return new AppException( | ||
Response.Status.BAD_REQUEST, buildMessageByName(appName, name, errorMessage)); | ||
} | ||
|
||
private static String buildMessageByName(String appName, String name, String errorMessage) { | ||
return String.format(BY_NAME_MESSAGE, appName, name, errorMessage); | ||
} | ||
} |
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