mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
use fail-safe rendering for Diagnostic objects (IDEA-360273)
GitOrigin-RevId: 66df25cae0d59e3cb57cf228f642cc76b922e5ec
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f30b88f9fc
commit
d03f7bf818
@@ -172,7 +172,21 @@ public final class APIWrappers {
|
||||
}
|
||||
|
||||
public String getMessage(Locale locale) {
|
||||
return myProcContext.adjustMessage(getWrapperDelegate().getMessage(locale));
|
||||
try {
|
||||
try {
|
||||
return myProcContext.adjustMessage(getWrapperDelegate().getMessage(locale));
|
||||
}
|
||||
catch (Throwable e) {
|
||||
// Diagnostic.getMessage() can cause unexpected exceptions while building the message based on a structured data contained in the disgnostic object
|
||||
// For example, it may fail with a class name resolution error, if some symbols required to build a message are not resolvable at the moment
|
||||
// Sometimes just repeating a call helps to get the actual diagnostic message
|
||||
return myProcContext.adjustMessage(getWrapperDelegate().getMessage(locale));
|
||||
}
|
||||
}
|
||||
catch (Throwable e) {
|
||||
// fallback logic
|
||||
return "Unexpected error: " + e.getClass() + ": " + e.getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user