move potentially long information from exception message to an attachment

This commit is contained in:
Dmitry Batrak
2016-07-28 21:22:17 +03:00
parent a09e96737b
commit c7e9a25ef8
@@ -17,6 +17,7 @@
package com.intellij.codeInsight.editorActions.moveUpDown;
import com.intellij.codeInsight.folding.CodeFoldingManager;
import com.intellij.openapi.diagnostic.Attachment;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.*;
import com.intellij.openapi.editor.ex.util.EditorUtil;
@@ -67,8 +68,9 @@ class MoverWrapper {
TextRange range = new TextRange(start, end);
TextRange range2 = new TextRange(start2, end2);
if (range.intersectsStrict(range2) && !range.equals(range2)) {
LOGGER.error("Wrong move ranges: " +
start + ":" + end + "(" + textToInsert + "), " + start2 + ":" + end2 + "(" + textToInsert2 + "), mover: " + myMover);
LOGGER.error("Wrong move ranges requested by " + myMover,
new Attachment("ranges.txt",
start + ":" + end + "(" + textToInsert + ")\n" + start2 + ":" + end2 + "(" + textToInsert2 + ")"));
return;
}