diff --git a/apps/sam/java/src/net/i2p/sam/SAMv1Handler.java b/apps/sam/java/src/net/i2p/sam/SAMv1Handler.java index 92c0384e5af8d0c70645e5bc343aac843f50a622..f91db2dd84a95b7666228049527b12647124b662 100644 --- a/apps/sam/java/src/net/i2p/sam/SAMv1Handler.java +++ b/apps/sam/java/src/net/i2p/sam/SAMv1Handler.java @@ -308,18 +308,16 @@ class SAMv1Handler extends SAMHandler implements SAMRawReceiver, SAMDatagramRece return writeString(SESSION_ERROR, "Unrecognized opcode"); } } catch (DataFormatException e) { - if (_log.shouldLog(Log.DEBUG)) - _log.debug("Invalid destination specified"); + _log.error("Invalid SAM destination specified", e); return writeString("SESSION STATUS RESULT=INVALID_KEY", e.getMessage()); } catch (I2PSessionException e) { - if (_log.shouldLog(Log.DEBUG)) - _log.debug("I2P error when instantiating session", e); + _log.error("Failed to start SAM session", e); return writeString(SESSION_ERROR, e.getMessage()); } catch (SAMException e) { - _log.error("Unexpected SAM error", e); + _log.error("Failed to start SAM session", e); return writeString(SESSION_ERROR, e.getMessage()); } catch (IOException e) { - _log.error("Unexpected IOException", e); + _log.error("Failed to start SAM session", e); return writeString(SESSION_ERROR, e.getMessage()); } } diff --git a/apps/sam/java/src/net/i2p/sam/SAMv3Handler.java b/apps/sam/java/src/net/i2p/sam/SAMv3Handler.java index 70a7475f153ac03f4e3053cafebedbd2d780db11..0b918186225fa1aa20c5aeb9c23bc41152a9f9fa 100644 --- a/apps/sam/java/src/net/i2p/sam/SAMv3Handler.java +++ b/apps/sam/java/src/net/i2p/sam/SAMv3Handler.java @@ -542,19 +542,16 @@ class SAMv3Handler extends SAMv1Handler return writeString(SESSION_ERROR, "Unrecognized opcode"); } } catch (DataFormatException e) { - if (_log.shouldLog(Log.DEBUG)) - _log.debug("Invalid destination specified"); + _log.error("Invalid SAM destination specified", e); return writeString("SESSION STATUS RESULT=INVALID_KEY", e.getMessage()); } catch (I2PSessionException e) { - if (_log.shouldLog(Log.DEBUG)) - _log.debug("I2P error when instantiating session", e); + _log.error("Failed to start SAM session", e); return writeString(SESSION_ERROR, e.getMessage()); } catch (SAMException e) { - if (_log.shouldLog(Log.INFO)) - _log.info("Funny SAM error", e); + _log.error("Failed to start SAM session", e); return writeString(SESSION_ERROR, e.getMessage()); } catch (IOException e) { - _log.error("Unexpected IOException", e); + _log.error("Failed to start SAM session", e); return writeString(SESSION_ERROR, e.getMessage()); } finally { // unregister the session if it has not been created