From 911aae12785addfc349c9066617fad4c9f79b1af Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 11 Aug 2007 15:52:36 -0700 Subject: [PATCH] In the dataReceived: method if an error is in the response, set the error on the window * Source/DebuggerConnection.m: ([DebuggerConnection dataReceived:deliverTo:]): If the response XML contains an error tag, set the error of the window to be the error message --- Source/DebuggerConnection.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Source/DebuggerConnection.m b/Source/DebuggerConnection.m index db5f329..d4b6d18 100644 --- a/Source/DebuggerConnection.m +++ b/Source/DebuggerConnection.m @@ -113,6 +113,14 @@ { NSXMLDocument *doc = [[NSXMLDocument alloc] initWithData: response options: NSXMLDocumentTidyXML error: nil]; + // check and see if there's an error + NSArray *error = [[doc rootElement] elementsForName: @"error"]; + if ([error count] > 0) + { + [_windowController setError: [[[[error objectAtIndex: 0] children] objectAtIndex: 0] stringValue]]; + return; + } + // if the caller of [_socket receive:] specified a deliverTo, just forward the message to them if (selector != nil) { -- 2.22.5