template.merge(context, writer);
} finally {
writer.close();
}
} catch (ResourceNotFoundException e) {
throw new AutotagRuntimeException("Cannot find template resource",
e);
} catch (ParseErrorException e) {
throw new AutotagRuntimeException(
"The template resource is not parseable", e);
} catch (IOException e) {
throw new AutotagRuntimeException(
"I/O Exception when generating file", e);
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new AutotagRuntimeException(
"Another generic exception while parsing the template resource",
e);
}
}