public CloudDebugRunConfigurationPanel(Project ideProject) { this.ideProject = ideProject; docsLink.setHyperlinkText( StackdriverDebuggerBundle.message("clouddebug.runconfig.formoredetails"), StackdriverDebuggerBundle.message("clouddebug.runconfig.documentation.url.text"), "."); docsLink.setHyperlinkTarget( StackdriverDebuggerBundle.message("clouddebug.runconfig.documentation.url")); description.setText(StackdriverDebuggerBundle.message("clouddebug.runconfig.description")); }
public static String getString( @NotNull @PropertyKey(resourceBundle = BUNDLE_NAME) String key, @NotNull Object... params) { return message(key, params); } }
private void handleBreakpointQueryError(@NotNull CloudDebugProcessState state, String message) { state.setListenInBackground(false); String title = StackdriverDebuggerBundle.message("clouddebug.background.listener.error.title"); Notification notification = new Notification( CLOUD_DEBUGGER_ERROR_NOTIFICATIONS_DISPLAY_GROUP, title, message, NotificationType.ERROR); Notifications.Bus.notify(notification, state.getProject()); } }
private void handleBreakpointQueryError( @NotNull CloudDebugProcessState state, @NotNull Exception ex) { String message; String projectName = state.getProject().getName(); if (ex instanceof GoogleJsonResponseException) { GoogleJsonResponseException jsonResponseException = (GoogleJsonResponseException) ex; if (jsonResponseException.getStatusCode() == HttpURLConnection.HTTP_FORBIDDEN || jsonResponseException.getStatusCode() == HttpURLConnection.HTTP_UNAUTHORIZED) { message = StackdriverDebuggerBundle.message( "clouddebug.background.listener.access.error.message", projectName); } else { message = StackdriverDebuggerBundle.message( "clouddebug.background.listener.general.error.message", projectName, jsonResponseException.getDetails().getMessage()); } } else { message = StackdriverDebuggerBundle.message( "clouddebug.background.listener.general.error.message", projectName, ex.getLocalizedMessage()); } handleBreakpointQueryError(state, message); }
private static String resolveJsonResponseToMessage(GoogleJsonResponseException reason) { switch (reason.getStatusCode()) { case 403: return StackdriverDebuggerBundle.message("clouddebug.debug.targets.accessdenied"); default: return StackdriverDebuggerBundle.getString( "clouddebug.debug.targets.error", reason.getDetails().getMessage()); } }
handleBreakpointQueryError( state, StackdriverDebuggerBundle.message( "clouddebug.background.listener.access.error.message", state.getProject().getName()));