Do not log ProcessCanceledException in copy paste reference processor

It is rethrown and leads to inability to copy code

 #KT-5426
This commit is contained in:
Pavel V. Talanov
2014-10-07 17:42:19 +04:00
parent f8052817a8
commit 33cdefffe3
@@ -63,6 +63,7 @@ import org.jetbrains.jet.lang.psi.psiUtil.getReceiverExpression
import org.jetbrains.jet.utils.*
import org.jetbrains.jet.renderer.DescriptorRenderer
import org.jetbrains.jet.lang.resolve.descriptorUtil.isExtension
import com.intellij.openapi.progress.ProcessCanceledException
//NOTE: this class is based on CopyPasteReferenceProcessor and JavaCopyPasteReferenceProcessor
public class KotlinCopyPasteReferenceProcessor() : CopyPastePostProcessor<ReferenceTransferableData>() {
@@ -106,6 +107,12 @@ public class KotlinCopyPasteReferenceProcessor() : CopyPastePostProcessor<Refere
}
}
}
catch (e: ProcessCanceledException) {
// supposedly session can only be canceled from another thread
// do not log ProcessCanceledException as it is rethrown by IdeaLogger and code won't be copied
LOG.error("ProcessCanceledException while analyzing references in ${file.getName()}. References can't be processed.")
return listOf()
}
catch (e: Throwable) {
LOG.error("Exception in processing references for copy paste in file ${file.getName()}}", e)
return listOf()