forked from I2P_Developers/i2p.i2p
SAM: Log tweaks (ticket #1778)
This commit is contained in:
@ -308,18 +308,16 @@ class SAMv1Handler extends SAMHandler implements SAMRawReceiver, SAMDatagramRece
|
|||||||
return writeString(SESSION_ERROR, "Unrecognized opcode");
|
return writeString(SESSION_ERROR, "Unrecognized opcode");
|
||||||
}
|
}
|
||||||
} catch (DataFormatException e) {
|
} catch (DataFormatException e) {
|
||||||
if (_log.shouldLog(Log.DEBUG))
|
_log.error("Invalid SAM destination specified", e);
|
||||||
_log.debug("Invalid destination specified");
|
|
||||||
return writeString("SESSION STATUS RESULT=INVALID_KEY", e.getMessage());
|
return writeString("SESSION STATUS RESULT=INVALID_KEY", e.getMessage());
|
||||||
} catch (I2PSessionException e) {
|
} catch (I2PSessionException e) {
|
||||||
if (_log.shouldLog(Log.DEBUG))
|
_log.error("Failed to start SAM session", e);
|
||||||
_log.debug("I2P error when instantiating session", e);
|
|
||||||
return writeString(SESSION_ERROR, e.getMessage());
|
return writeString(SESSION_ERROR, e.getMessage());
|
||||||
} catch (SAMException e) {
|
} catch (SAMException e) {
|
||||||
_log.error("Unexpected SAM error", e);
|
_log.error("Failed to start SAM session", e);
|
||||||
return writeString(SESSION_ERROR, e.getMessage());
|
return writeString(SESSION_ERROR, e.getMessage());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
_log.error("Unexpected IOException", e);
|
_log.error("Failed to start SAM session", e);
|
||||||
return writeString(SESSION_ERROR, e.getMessage());
|
return writeString(SESSION_ERROR, e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -542,19 +542,16 @@ class SAMv3Handler extends SAMv1Handler
|
|||||||
return writeString(SESSION_ERROR, "Unrecognized opcode");
|
return writeString(SESSION_ERROR, "Unrecognized opcode");
|
||||||
}
|
}
|
||||||
} catch (DataFormatException e) {
|
} catch (DataFormatException e) {
|
||||||
if (_log.shouldLog(Log.DEBUG))
|
_log.error("Invalid SAM destination specified", e);
|
||||||
_log.debug("Invalid destination specified");
|
|
||||||
return writeString("SESSION STATUS RESULT=INVALID_KEY", e.getMessage());
|
return writeString("SESSION STATUS RESULT=INVALID_KEY", e.getMessage());
|
||||||
} catch (I2PSessionException e) {
|
} catch (I2PSessionException e) {
|
||||||
if (_log.shouldLog(Log.DEBUG))
|
_log.error("Failed to start SAM session", e);
|
||||||
_log.debug("I2P error when instantiating session", e);
|
|
||||||
return writeString(SESSION_ERROR, e.getMessage());
|
return writeString(SESSION_ERROR, e.getMessage());
|
||||||
} catch (SAMException e) {
|
} catch (SAMException e) {
|
||||||
if (_log.shouldLog(Log.INFO))
|
_log.error("Failed to start SAM session", e);
|
||||||
_log.info("Funny SAM error", e);
|
|
||||||
return writeString(SESSION_ERROR, e.getMessage());
|
return writeString(SESSION_ERROR, e.getMessage());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
_log.error("Unexpected IOException", e);
|
_log.error("Failed to start SAM session", e);
|
||||||
return writeString(SESSION_ERROR, e.getMessage());
|
return writeString(SESSION_ERROR, e.getMessage());
|
||||||
} finally {
|
} finally {
|
||||||
// unregister the session if it has not been created
|
// unregister the session if it has not been created
|
||||||
|
Reference in New Issue
Block a user