Click through errors to IntelliJ Idea editor with Remote Call plugin

connect Every improvement of your development process that is performed on daily basis is worth considering and implementing. Even little things can save days in budgets if you multiply them by the count of team members and the number of operation occurrences in the year. How do you look up for classes or JSP/FreeMarker/whatever templates when you run at error in them during development or testing? In development mode you might have your logging output open in IntelliJ Idea and click through exception stacktraces if any happens to be printed there. But there are cases when it's not possible - for example errors in templates won't navigate you to the source template, logs in test / preprod environment can't be easily consumed by your IDE etc.

So what do you do in such case? You search through the logs, locate the error, copy the name of the target file/class, go to you IDE and look up for it there. This might take tens of seconds, right? And now multiply it for your whole team ...

Luckily there is handy plugin for IntelliJ Idea that allows you integrate errors that you visualize in your browser with the IDE directly. Remote Call plugin opens up a port 8091 locally and when you render link in HTML output in the form of:

http://localhost:8091/?message=any/path/FileName.java:89

You'd be navigated directly to the file in the IDE if it's part of any of opened projects. You can navigate to any file (not only Java files) and you can also navigate to the exact line in that file. So we took this plugin and use it for these use-cases:

Navigation to FreeMarker templates

Whenever there is error in FreeMarker template it's get visualized like this (of course this version is used only in dev & test environment):

Single click will take us to the exact error line in the FreeMarker template. We only needed to override default FreeMarker exception handler (ie. implement freemarker.template.TemplateExceptionHandler).

Navigation to Java files

Whenever there is error in Java sources that results in HTTP 500 in dev/test we see this:

Navigation in documentation

We also generate some documentation from Java sources and include it in our MarkDown documentation as well. Even from there you can reach particular source in your IDE with single click:

Navigation in e-mail notifications

Finally we are notified about each error in production that affects the user or stops asynchronous processing. Each failure has to be addressed and even if there is minimum problems in the production (as it should be :) ) links are there quite handy too: