1
package com.thaiopensource.relaxng.parse;
3
import com.thaiopensource.resolver.ResolverException;
4
import org.xml.sax.SAXException;
6
public class BuildException extends RuntimeException {
7
private final Throwable cause;
8
public BuildException(Throwable cause) {
10
throw new NullPointerException("null cause");
14
public Throwable getCause() {
18
public static BuildException fromSAXException(SAXException e) {
19
Exception inner = e.getException();
20
if (inner instanceof BuildException)
21
return (BuildException)inner;
22
return new BuildException(e);
25
public static BuildException fromResolverException(ResolverException e) {
26
if (e.getMessage() == null) {
27
Throwable t = e.unwrap();
29
if (t instanceof BuildException)
30
throw (BuildException)t;
31
throw new BuildException(t);
34
throw new BuildException(e);