try { String[] content; content = e.getLocalizedMessage().split("\n"); LOG.error(cmd + ": " + content[0]); } catch (Exception ex) {
try { String[] content; content = e.getLocalizedMessage().split("\n"); System.err.println(cmd.substring(1) + ": " + content[0]);
/** Write the object to XML format */ public void writeXml(String path, XMLOutputter doc) throws IOException { doc.startTag(RemoteException.class.getSimpleName()); doc.attribute("path", path); doc.attribute("class", getClassName()); String msg = getLocalizedMessage(); int i = msg.indexOf("\n"); if (i >= 0) { msg = msg.substring(0, i); } doc.attribute("message", msg.substring(msg.indexOf(":") + 1).trim()); doc.endTag(); }
/** Write the object to XML format */ public void writeXml(String path, XMLOutputter doc) throws IOException { doc.startTag(RemoteException.class.getSimpleName()); doc.attribute("path", path); doc.attribute("class", getClassName()); String msg = getLocalizedMessage(); int i = msg.indexOf("\n"); if (i >= 0) { msg = msg.substring(0, i); } doc.attribute("message", msg.substring(msg.indexOf(":") + 1).trim()); doc.endTag(); }
String content = re.getLocalizedMessage(); int eol = content.indexOf('\n'); if (eol>=0) {
try { String[] content; content = e.getLocalizedMessage().split("\n"); System.err.println(cmd.substring(1) + ": " + content[0]);
try { String[] content; content = e.getLocalizedMessage().split("\n"); System.err.println(cmd.substring(1) + ": " + content[0]); } catch (Exception ex) {
try { String[] content; content = e.getLocalizedMessage().split("\n"); System.err.println(cmd.substring(1) + ": " + content[0]); } catch (Exception ex) {
content = e.getLocalizedMessage().split("\n"); System.err.println(cmd.substring(1) + ": " + content[0]);
content = e.getLocalizedMessage().split("\n"); System.err.println(cmd.substring(1) + ": " + content[0]);
content = e.getLocalizedMessage().split("\n"); System.err.println(cmd.substring(1) + ": " + content[0]);
content = e.getLocalizedMessage().split("\n"); System.err.println(cmd.substring(1) + ": " + content[0]);
@Test public void testErrorMessage() throws Exception { BadTokenSecretManager sm = new BadTokenSecretManager(); final Server server = RPC.getServer(TestSaslProtocol.class, new TestSaslImpl(), ADDRESS, 0, 5, true, conf, sm); boolean succeeded = false; try { doDigestRpc(server, sm); } catch (RemoteException e) { LOG.info("LOGGING MESSAGE: " + e.getLocalizedMessage()); assertTrue(ERROR_MESSAGE.equals(e.getLocalizedMessage())); assertTrue(e.unwrapRemoteException() instanceof InvalidToken); succeeded = true; } assertTrue(succeeded); }
try { String[] content; content = e.getLocalizedMessage().split("\n"); LOG.error(cmd + ": " + content[0]); } catch (Exception ex) {
try { String[] content; content = e.getLocalizedMessage().split("\n"); LOG.error(cmd + ": " + content[0]); } catch (Exception ex) {
TestProtocol.versionID, addr, conf); } catch (RemoteException e) { LOG.info("LOGGING MESSAGE: " + e.getLocalizedMessage()); assertTrue(e.unwrapRemoteException() instanceof AccessControlException); succeeded = true; TestProtocol.versionID, mulitServerAddr, conf); } catch (RemoteException e) { LOG.info("LOGGING MESSAGE: " + e.getLocalizedMessage()); assertTrue(e.unwrapRemoteException() instanceof AccessControlException); succeeded = true;
@Test public void testErrorMessage() throws Exception { BadTokenSecretManager sm = new BadTokenSecretManager(); final Server server = new RPC.Builder(conf) .setProtocol(TestSaslProtocol.class).setInstance(new TestSaslImpl()) .setBindAddress(ADDRESS).setPort(0).setNumHandlers(5).setVerbose(true) .setSecretManager(sm).build(); boolean succeeded = false; try { doDigestRpc(server, sm); } catch (RemoteException e) { LOG.info("LOGGING MESSAGE: " + e.getLocalizedMessage()); assertEquals(ERROR_MESSAGE, e.getLocalizedMessage()); assertTrue(e.unwrapRemoteException() instanceof InvalidToken); succeeded = true; } assertTrue(succeeded); }
@Test public void testErrorMessage() throws Exception { BadTokenSecretManager sm = new BadTokenSecretManager(); final Server server = new RPC.Builder(conf) .setProtocol(TestSaslProtocol.class).setInstance(new TestSaslImpl()) .setBindAddress(ADDRESS).setPort(0).setNumHandlers(5).setVerbose(true) .setSecretManager(sm).build(); boolean succeeded = false; try { doDigestRpc(server, sm); } catch (RemoteException e) { LOG.info("LOGGING MESSAGE: " + e.getLocalizedMessage()); assertEquals(ERROR_MESSAGE, e.getLocalizedMessage()); assertTrue(e.unwrapRemoteException() instanceof InvalidToken); succeeded = true; } assertTrue(succeeded); }
proxy.echo(""); } catch (RemoteException e) { LOG.info("LOGGING MESSAGE: " + e.getLocalizedMessage()); assertTrue(e.unwrapRemoteException() instanceof AccessControlException); succeeded = true; proxy.echo(""); } catch (RemoteException e) { LOG.info("LOGGING MESSAGE: " + e.getLocalizedMessage()); assertTrue(e.unwrapRemoteException() instanceof AccessControlException); succeeded = true;
proxy.echo(""); } catch (RemoteException e) { LOG.info("LOGGING MESSAGE: " + e.getLocalizedMessage()); assertTrue(e.unwrapRemoteException() instanceof AccessControlException); succeeded = true; proxy.echo(""); } catch (RemoteException e) { LOG.info("LOGGING MESSAGE: " + e.getLocalizedMessage()); assertTrue(e.unwrapRemoteException() instanceof AccessControlException); succeeded = true;