From 275d0bbf555c8917be82ce4cc21eb4cabb00f4c5 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Fri, 3 Oct 2014 17:30:41 +0200 Subject: Huge exception overhaul: Merged ClusterStorageException with PersistencyException. Replaced MembershipException with InvalidCollectionModification CORBA Exception. Made all predef steps throw more accurate exceptions when they go wrong, and let more exceptions bubble through from underneath. --- .../com/c2kernel/persistency/outcome/OutcomeValidator.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/main/java/com/c2kernel/persistency/outcome/OutcomeValidator.java') diff --git a/src/main/java/com/c2kernel/persistency/outcome/OutcomeValidator.java b/src/main/java/com/c2kernel/persistency/outcome/OutcomeValidator.java index defac3a..d89f7e7 100644 --- a/src/main/java/com/c2kernel/persistency/outcome/OutcomeValidator.java +++ b/src/main/java/com/c2kernel/persistency/outcome/OutcomeValidator.java @@ -38,7 +38,7 @@ import org.xml.sax.ErrorHandler; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; -import com.c2kernel.common.InvalidDataException; +import com.c2kernel.common.InvalidData; import com.c2kernel.utils.Logger; /************************************************************************** @@ -69,7 +69,7 @@ public class OutcomeValidator implements ErrorHandler, XMLErrorHandler { XMLGrammarPoolImpl schemaGrammarPool = new XMLGrammarPoolImpl(1); SymbolTable sym = new SymbolTable(); - public static OutcomeValidator getValidator(Schema schema) throws InvalidDataException { + public static OutcomeValidator getValidator(Schema schema) throws InvalidData { if (schema.docType.equals("Schema") && schema.docVersion==0) @@ -82,11 +82,11 @@ public class OutcomeValidator implements ErrorHandler, XMLErrorHandler { errors = new StringBuffer(); } - public OutcomeValidator(Schema schema) throws InvalidDataException { + public OutcomeValidator(Schema schema) throws InvalidData { this.schema = schema; if (schema.docType.equals("Schema")) - throw new InvalidDataException("Use SchemaValidator to validate schema", ""); + throw new InvalidData("Use SchemaValidator to validate schema"); errors = new StringBuffer(); Logger.msg(5, "Parsing "+schema.docType+" version "+schema.docVersion+". "+schema.schema.length()+" chars"); @@ -103,11 +103,11 @@ public class OutcomeValidator implements ErrorHandler, XMLErrorHandler { try { preparser.preparseGrammar(XMLGrammarDescription.XML_SCHEMA, new XMLInputSource(null, null, null, new StringReader(schema.schema), null)); } catch (IOException ex) { - throw new InvalidDataException("Error parsing schema: "+ex.getMessage(), ""); + throw new InvalidData("Error parsing schema: "+ex.getMessage()); } if (errors.length() > 0) { - throw new InvalidDataException("Schema error: \n"+errors.toString(), ""); + throw new InvalidData("Schema error: \n"+errors.toString()); } } -- cgit v1.2.3