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)

1  
static new AtomicLong _handleError_nonVMErrors;
2  
static new AtomicLong _handleError_vmErrors;
3  
static new AtomicLong _handleError_outOfMemoryErrors;
4  
static volatile long _handleError_lastOutOfMemoryError;
5  
static volatile Error _handleError_lastHardError;
6  
7  
static void _handleError(Error e) {
8  
  if (!(e instanceof VirtualMachineError)) {
9  
    incAtomicLong(_handleError_nonVMErrors);
10  
    ret;
11  
  }
12  
  
13  
  print("\nHARD ERROR\n");
14  
  printStackTrace2(e);
15  
  print("\nHARD ERROR\n");
16  
  _handleError_lastHardError = e;
17  
  
18  
  incAtomicLong(_handleError_vmErrors);
19  
  if (e instanceof OutOfMemoryError) {
20  
    incAtomicLong(_handleError_outOfMemoryErrors);
21  
    _handleError_lastOutOfMemoryError = sysNow();
22  
  }
23  
}

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: 342 / 1036
Referenced in: [show references]