ExternalSystemException (@NotNull String msg, @Nullable String location, String @NotNull ... quickFixes) { String newMsg = msg; if (!newMsg.isEmpty() && Character.isLowerCase(newMsg.charAt(0))) { // Message starts with lower case letter. Sentences should start with uppercase. newMsg = "Cause: " + newMsg; } if (!StringUtil.isEmpty(location)) { Pair<String, Integer> pair = getErrorLocation(location); if (pair != null) { return new LocationAwareExternalSystemException(newMsg, pair.first, pair.getSecond(), quickFixes); } } return new ExternalSystemException(newMsg, null, quickFixes); }