Changeset f80ea38


Ignore:
Timestamp:
Jul 7, 2013 5:20:06 PM (7 years ago)
Author:
zab2 <zab2@…>
Branches:
master
Children:
e9e550fb
Parents:
7429762
Message:

Log errors to logger if available

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/streaming/java/src/net/i2p/client/streaming/Packet.java

    r7429762 rf80ea38  
    450450                System.arraycopy(_payload.getData(), _payload.getOffset(), buffer, cur, _payload.getValid());
    451451            } catch (ArrayIndexOutOfBoundsException aioobe) {
    452                 System.err.println("payload.length: " + _payload.getValid() + " buffer.length: " + buffer.length + " cur: " + cur);
     452                String error = "payload.length: " + _payload.getValid() + " buffer.length: " + buffer.length + " cur: " + cur;
     453                I2PAppContext context = I2PAppContext.getCurrentContext();
     454                if (context != null) {
     455                    Log l = context.logManager().getLog(Packet.class);
     456                    l.log(Log.ERROR,error,aioobe);
     457                } else {
     458                    System.err.println(error);
     459                    aioobe.printStackTrace(System.out);
     460                }
    453461                throw aioobe;
    454462            }
Note: See TracChangeset for help on using the changeset viewer.