Skip to content
Snippets Groups Projects
Commit ccb917b3 authored by Raphael GIRARDOT's avatar Raphael GIRARDOT
Browse files

minor changes

parent 15a904ec
No related branches found
No related merge requests found
......@@ -323,6 +323,16 @@ public abstract class ArchiverCollector implements IErrorListener {
return result;
}
/**
* Appends the stack trace of a {@link Throwable} to a {@link StringBuilder}. If the {@link Throwable} is a
* {@link DevFailed}, this method will append the result of {@link DevFailedUtils#toString(DevFailed)} to the
* {@link StringBuilder} instead of the stack trace.
*
* @param builder The {@link StringBuilder} to which to append the stack trace. If <code>null</code>, a new one will
* be created.
* @param error The {@link Throwable} of which the stack trace must be extracted.
* @return A {@link StringBuilder}, never <code>null</code>.
*/
public static StringBuilder appendErrorToStringBuilder(StringBuilder builder, Throwable error) {
if (builder == null) {
builder = new StringBuilder();
......
......@@ -208,7 +208,7 @@ public abstract class HdbCollector extends ArchiverCollector {
} else {
addSourceForPolling(attributeLightMode);
}
} catch (ArchivingException e) {
} catch (Exception e) {
final String message = e.getMessage();
if ((attributeLightMode != null) && (message != null)) {
final String name = attributeLightMode.getAttributeCompleteName();
......@@ -216,7 +216,12 @@ public abstract class HdbCollector extends ArchiverCollector {
registerErrorMessage(name, message);
}
}
throw e;
if (e instanceof ArchivingException) {
throw (ArchivingException) e;
} else {
ArchivingException exception = new ArchivingException(appendErrorToStringBuilder(null, e).toString());
throw exception;
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment