Psi2ir: improve exception stack traces

- Do not wrap exceptions resulting from generating error expressions
  multiple times, as that could lead to stack traces where the identical
  code is wrapped many times and is printed in the exception message on
  each step, which was difficult to read
- Add element location (file name, line number & position) to the
  message, similarly to exceptions from codegen, when catching and
  rethrowing exceptions at the top level
This commit is contained in:
Alexander Udalov
2020-11-04 13:30:12 +01:00
parent 3cb202f576
commit c1a292b01b
6 changed files with 45 additions and 13 deletions
@@ -75,7 +75,7 @@ public class PackageCodegenImpl implements PackageCodegen {
}
catch (Throwable e) {
VirtualFile vFile = file.getVirtualFile();
CodegenUtil.reportBackendException(e, "file facade code generation", vFile == null ? null : vFile.getUrl());
CodegenUtil.reportBackendException(e, "file facade code generation", vFile == null ? null : vFile.getUrl(), null);
}
}
}