2006/unicorn/src/org/w3c/unicorn/response/impl DefaultResponseXBeans.java,1.9,1.10

Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/response/impl
In directory hutz:/tmp/cvs-serv14403/src/org/w3c/unicorn/response/impl

Modified Files:
	DefaultResponseXBeans.java 
Log Message:
updated exception messages

Index: DefaultResponseXBeans.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/response/impl/DefaultResponseXBeans.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- DefaultResponseXBeans.java	21 Oct 2009 16:35:13 -0000	1.9
+++ DefaultResponseXBeans.java	22 Oct 2009 17:11:58 -0000	1.10
@@ -25,6 +25,7 @@
 import org.w3c.unicorn.response.Group;
 import org.w3c.unicorn.response.Message;
 import org.w3c.unicorn.response.Response;
+import org.w3c.unicorn.util.Property;
 import org.w3c.unicorn.exceptions.UnicornException;
 
 public class DefaultResponseXBeans implements Response {
@@ -43,6 +44,8 @@
 	
 	private String observerID;
 	
+	//TODO lang information is missing here, something must be added to the schema
+	
 	public DefaultResponseXBeans(InputStream is, String charset) throws UnicornException {
 		
 		if (charset == null)
@@ -52,10 +55,10 @@
 			ord = ObservationresponseDocument.Factory.parse(is, new XmlOptions().setCharacterEncoding(charset));
 			or = ord.getObservationresponse();
 			if (!or.validate())
-				throw new UnicornException(new org.w3c.unicorn.util.Message(2, "$message_response_validation_error"));
+				throw new UnicornException(new org.w3c.unicorn.util.Message(2, "$message_response_validation_error", null, Framework.mapOfObserver.get(observerID).getName(Property.get("DEFAULT_LANGUAGE"))));
 		} catch (XmlException e) {
 			if (e.getMessage().contains("is not a valid observationresponse"))
-				throw new UnicornException(new org.w3c.unicorn.util.Message(org.w3c.unicorn.util.Message.ERROR, "$message_observer_invalid_response_schema"));
+				throw new UnicornException(new org.w3c.unicorn.util.Message(org.w3c.unicorn.util.Message.ERROR, "$message_response_invalid_schema", null, Framework.mapOfObserver.get(observerID).getName(Property.get("DEFAULT_LANGUAGE"))));
 			else
 				throw new UnicornException(new org.w3c.unicorn.util.Message(e));
 		} catch (IOException e) {

Received on Thursday, 22 October 2009 17:12:02 UTC