@Test public void testException () { final Exception ex = new IllegalArgumentException ("bla foo"); final IJsonObject aObj = BDVEJsonHelper.getJsonStackTrace (ex); assertNotNull (aObj); }
@Nullable public static IJsonObject getJsonStackTrace (@Nullable final Throwable t) { if (t == null) return null; if (t instanceof BDVERestoredException) return ((BDVERestoredException) t).getAsJson (); return new JsonObject ().add (JSON_CLASS, t.getClass ().getName ()) .addIfNotNull (JSON_MESSAGE, t.getMessage ()) .add (JSON_STACK_TRACE, StackTraceHelper.getStackAsString (t)); }
BDVEJsonHelper { @Nullable public static IJsonObject getJsonStackTrace (@Nullable final Throwable t) { if (t == null) return null; if (t instanceof BDVERestoredException) return ((BDVERestoredException) t).getAsJson (); return new JsonObject ().add (JSON_CLASS, t.getClass ().getName ()) .addIfNotNull (JSON_MESSAGE, t.getMessage ()) .add (JSON_STACK_TRACE, StackTraceHelper.getStackAsString (t)); } }
BDVEJsonHelper { @Nullable public static IJsonObject getJsonStackTrace (@Nullable final Throwable t) { if (t == null) return null; if (t instanceof BDVERestoredException) return ((BDVERestoredException) t).getAsJson (); return new JsonObject ().add (JSON_CLASS, t.getClass ().getName ()) .addIfNotNull (JSON_MESSAGE, t.getMessage ()) .add (JSON_STACK_TRACE, StackTraceHelper.getStackAsString (t)); } private  BDVEJsonHelper(); }
BDVEJsonHelper { @Nullable public static IJsonObject getJsonStackTrace (@Nullable final Throwable t) { if (t == null) return null; if (t instanceof BDVERestoredException) return ((BDVERestoredException) t).getAsJson (); return new JsonObject ().add (JSON_CLASS, t.getClass ().getName ()) .addIfNotNull (JSON_MESSAGE, t.getMessage ()) .add (JSON_STACK_TRACE, StackTraceHelper.getStackAsString (t)); } private  BDVEJsonHelper(); @Nonnull @Nonempty static String getJsonErrorLevel(@Nonnull final IErrorLevel aErrorLevel); @Nullable static IErrorLevel getAsErrorLevel(@Nullable final String sErrorLevel); @Nonnull @Nonempty static String getJsonTriState(final boolean b); @Nonnull static String getJsonTriState(@Nonnull final ETriState eTriState); @Nullable static ETriState getAsTriState(@Nullable final String sTriState); @Nullable static IJsonObject getJsonStackTrace(@Nullable final Throwable t); @Nullable static IJsonObject getJsonErrorLocation(@Nullable final ILocation aLocation); @Nullable static ILocation getAsErrorLocation(@Nullable final IJsonObject aObj); @Nonnull static IJsonObject getJsonError(@Nonnull final IErrorLevel aErrorLevel,
                                          @Nullable final String sErrorID,
                                          @Nullable final String sErrorFieldName,
                                          @Nullable final ILocation aErrorLocation,
                                          @Nullable final String sTest,
                                          @Nonnull final String sErrorText,
                                          @Nullable final Throwable t); @Nonnull static IJsonObject getJsonError(@Nonnull final IError aError, @Nonnull final Locale aDisplayLocale); @Nonnull static IError getAsIError(@Nonnull final IJsonObject aObj); @Nonnull static IJsonObject getJsonVES(@Nonnull final IValidationExecutorSet <?> aVES); static void applyGlobalError(@Nonnull final IJsonObject aResponse,
                                       @Nonnull final String sErrorMsg,
                                       @Nonnegative final long nDurationMilliseconds); @Nonnull @Nonempty static String getArtifactPathType(@Nonnull final IReadableResource aRes); static void applyValidationResultList(@Nonnull final IJsonObject aResponse,
                                                @Nonnull final IValidationExecutorSet <?> aVES,
                                                @Nonnull final List <? extends ValidationResult> aValidationResultList,
                                                @Nonnull final Locale aDisplayLocale,
                                                @Nonnegative final long nDurationMilliseconds,
                                                @Nullable final MutableInt aWarningCount,
                                                @Nullable final MutableInt aErrorCount); @Nullable static IValidationExecutorSet <T> getAsVES(@Nonnull final ValidationExecutorSetRegistry <T> aRegistry,
                                                                                   @Nullable final IJsonObject aJson); @Nullable static IReadableResource getAsValidationResource(@Nullable final String sArtefactPathType, @Nullable final String sArtefactPath); @Nullable static ValidationResultList getAsValidationResultList(@Nullable final IJsonObject aJson); }
BDVEJsonHelper { @Nullable public static IJsonObject getJsonStackTrace (@Nullable final Throwable t) { if (t == null) return null; if (t instanceof BDVERestoredException) return ((BDVERestoredException) t).getAsJson (); return new JsonObject ().add (JSON_CLASS, t.getClass ().getName ()) .addIfNotNull (JSON_MESSAGE, t.getMessage ()) .add (JSON_STACK_TRACE, StackTraceHelper.getStackAsString (t)); } private  BDVEJsonHelper(); @Nonnull @Nonempty static String getJsonErrorLevel(@Nonnull final IErrorLevel aErrorLevel); @Nullable static IErrorLevel getAsErrorLevel(@Nullable final String sErrorLevel); @Nonnull @Nonempty static String getJsonTriState(final boolean b); @Nonnull static String getJsonTriState(@Nonnull final ETriState eTriState); @Nullable static ETriState getAsTriState(@Nullable final String sTriState); @Nullable static IJsonObject getJsonStackTrace(@Nullable final Throwable t); @Nullable static IJsonObject getJsonErrorLocation(@Nullable final ILocation aLocation); @Nullable static ILocation getAsErrorLocation(@Nullable final IJsonObject aObj); @Nonnull static IJsonObject getJsonError(@Nonnull final IErrorLevel aErrorLevel,
                                          @Nullable final String sErrorID,
                                          @Nullable final String sErrorFieldName,
                                          @Nullable final ILocation aErrorLocation,
                                          @Nullable final String sTest,
                                          @Nonnull final String sErrorText,
                                          @Nullable final Throwable t); @Nonnull static IJsonObject getJsonError(@Nonnull final IError aError, @Nonnull final Locale aDisplayLocale); @Nonnull static IError getAsIError(@Nonnull final IJsonObject aObj); @Nonnull static IJsonObject getJsonVES(@Nonnull final IValidationExecutorSet <?> aVES); static void applyGlobalError(@Nonnull final IJsonObject aResponse,
                                       @Nonnull final String sErrorMsg,
                                       @Nonnegative final long nDurationMilliseconds); @Nonnull @Nonempty static String getArtifactPathType(@Nonnull final IReadableResource aRes); static void applyValidationResultList(@Nonnull final IJsonObject aResponse,
                                                @Nonnull final IValidationExecutorSet <?> aVES,
                                                @Nonnull final List <? extends ValidationResult> aValidationResultList,
                                                @Nonnull final Locale aDisplayLocale,
                                                @Nonnegative final long nDurationMilliseconds,
                                                @Nullable final MutableInt aWarningCount,
                                                @Nullable final MutableInt aErrorCount); @Nullable static IValidationExecutorSet <T> getAsVES(@Nonnull final ValidationExecutorSetRegistry <T> aRegistry,
                                                                                   @Nullable final IJsonObject aJson); @Nullable static IReadableResource getAsValidationResource(@Nullable final String sArtefactPathType, @Nullable final String sArtefactPath); @Nullable static ValidationResultList getAsValidationResultList(@Nullable final IJsonObject aJson); static final String JSON_ERRORLEVEL_SUCCESS; static final String JSON_ERRORLEVEL_WARN; static final String JSON_ERRORLEVEL_ERROR; static final String JSON_TRISTATE_TRUE; static final String JSON_TRISTATE_FALSE; static final String JSON_TRISTATE_UNDEFINED; static final String JSON_CLASS; static final String JSON_MESSAGE; static final String JSON_STACK_TRACE; static final String JSON_RESOURCE_ID; static final String JSON_LINE_NUM; static final String JSON_COLUMN_NUM; static final String JSON_ERROR_LEVEL; static final String JSON_ERROR_ID; static final String JSON_ERROR_FIELD_NAME; static final String JSON_ERROR_LOCATION_OBJ; static final String JSON_ERROR_LOCATION_STR; static final String JSON_ERROR_TEXT; static final String JSON_EXCEPTION; static final String JSON_TEST; static final String JSON_VESID; static final String JSON_NAME; static final String JSON_DEPRECATED; static final String JSON_SUCCESS; static final String JSON_ARTIFACT_TYPE; static final String JSON_ARTIFACT_PATH_TYPE; static final String JSON_ARTIFACT_PATH; static final String JSON_ITEMS; static final String JSON_INTERRUPTED; static final String JSON_MOST_SEVERE_ERROR_LEVEL; static final String JSON_RESULTS; static final String JSON_DURATION_MS; static final String JSON_VES; static final String ARTFACT_TYPE_INPUT_PARAMETER; static final String ARTIFACT_PATH_NONE; }