mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
'Show Serialized XML' action: show serialization exceptions (EA-55882)
This commit is contained in:
@@ -41,6 +41,7 @@ import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.util.containers.FList;
|
||||
import com.intellij.util.lang.UrlClassLoader;
|
||||
import com.intellij.util.xmlb.Accessor;
|
||||
import com.intellij.util.xmlb.XmlSerializationException;
|
||||
import com.intellij.util.xmlb.XmlSerializer;
|
||||
import com.intellij.util.xmlb.XmlSerializerUtil;
|
||||
import org.jdom.Element;
|
||||
@@ -121,7 +122,16 @@ public class ShowSerializedXmlAction extends DumbAwareAction {
|
||||
return;
|
||||
}
|
||||
|
||||
final Element element = XmlSerializer.serialize(o);
|
||||
final Element element;
|
||||
try {
|
||||
element = XmlSerializer.serialize(o);
|
||||
}
|
||||
catch (XmlSerializationException e) {
|
||||
LOG.info(e);
|
||||
Throwable cause = e.getCause();
|
||||
Messages.showErrorDialog(project, e.getMessage() + (cause != null ? ": " + cause.getMessage() : ""), CommonBundle.getErrorTitle());
|
||||
return;
|
||||
}
|
||||
final String text = JDOMUtil.writeElement(element, "\n");
|
||||
Messages.showIdeaMessageDialog(project, text, "Serialized XML for '" + className + "'",
|
||||
new String[]{CommonBundle.getOkButtonText()}, 0, Messages.getInformationIcon(), null);
|
||||
|
||||
Reference in New Issue
Block a user