Changeset 80e3c96 for core


Ignore:
Timestamp:
Dec 1, 2017 3:57:54 PM (3 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
f8e871c
Parents:
dc13ed6
Message:

LeaseSet?: Better error messages when decode fails (ticket #2108)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/data/LeaseSet.java

    rdc13ed6 r80e3c96  
    491491        int size = _leases.size();
    492492        if (size < 2)
    493             throw new DataFormatException("Bad number of leases for decryption");
     493            throw new DataFormatException("Bad number of leases decrypting " + _destination.toBase32() +
     494                                          " - is this destination encrypted?");
    494495        int datalen = DATA_LEN * size;
    495496        ByteArrayOutputStream baos = new ByteArrayOutputStream(datalen);
     
    540541            } catch (DataFormatException dfe) {
    541542                Log log = I2PAppContext.getGlobalContext().logManager().getLog(LeaseSet.class);
    542                 log.error("Error decrypting lease: " + _destination.calculateHash(), dfe);
     543                log.error("Error decrypting " + _destination.toBase32() +
     544                          " - is this destination encrypted?", dfe);
    543545            } catch (IOException ioe) {
    544546                Log log = I2PAppContext.getGlobalContext().logManager().getLog(LeaseSet.class);
    545                 log.error("Error decrypting lease: " + _destination.calculateHash(), ioe);
     547                log.error("Error decrypting " + _destination.toBase32() +
     548                          " - is this destination encrypted?", ioe);
    546549            }
    547550        }
Note: See TracChangeset for help on using the changeset viewer.