Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

23
LINES

< > BotCompany Repo | #1016423 // _handleError - store hard errors (OutOfMemoryError etc., core version)

JavaX fragment (include)

static new AtomicLong _handleError_nonVMErrors;
static new AtomicLong _handleError_vmErrors;
static new AtomicLong _handleError_outOfMemoryErrors;
static volatile long _handleError_lastOutOfMemoryError;
static volatile Error _handleError_lastHardError;

static void _handleError(Error e) {
  if (!(e instanceof VirtualMachineError)) {
    incAtomicLong(_handleError_nonVMErrors);
    ret;
  }
  
  print("\nHARD ERROR\n");
  printStackTrace2(e);
  print("\nHARD ERROR\n");
  _handleError_lastHardError = e;
  
  incAtomicLong(_handleError_vmErrors);
  if (e instanceof OutOfMemoryError) {
    incAtomicLong(_handleError_outOfMemoryErrors);
    _handleError_lastOutOfMemoryError = sysNow();
  }
}

Author comment

Began life as a copy of #1011792

download  show line numbers  debug dex  old transpilations   

Travelled to 16 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1016423
Snippet name: _handleError - store hard errors (OutOfMemoryError etc., core version)
Eternal ID of this version: #1016423/1
Text MD5: 2f2ba0055461453f18015a0ef2c02e26
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-06-18 13:56:14
Source code size: 717 bytes / 23 lines
Pitched / IR pitched: No / No
Views / Downloads: 343 / 1036
Referenced in: [show references]