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

6
LINES

< > BotCompany Repo | #1033995 // rethrowAndAppendToMessage

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (5001L/28K).

static RuntimeException rethrowAndAppendToMessage(Throwable t, S msg) {
  S haveMsg = t.getMessage();
  if (empty(msg) || endsWith(haveMsg, " " + msg))
    throw rethrow(t);
  throw new RuntimeException(joinWithSpace(t.getMessage(), msg), t);
}

Author comment

Began life as a copy of #1007211

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1033995
Snippet name: rethrowAndAppendToMessage
Eternal ID of this version: #1033995/4
Text MD5: 6701c499384408cd0c9e3d1618e84efc
Transpilation MD5: f11ec915c701a4ec57592a4342db76c1
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-29 14:42:21
Source code size: 249 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 93 / 157
Version history: 3 change(s)
Referenced in: [show references]