Skip to content

Commit

Permalink
Show error instead of warning in case of exception
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPl292 committed Oct 20, 2023
1 parent 25877e3 commit 8c06767
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/main/java/com/maddyhome/idea/vim/newapi/IjVimLogger.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ internal class IjVimLogger(private val logger: Logger) : VimLogger {
logger.error(message)
}

override fun error(message: String, e: Throwable) {
logger.error(message, e)
}

override fun info(message: String) {
logger.info(message)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,20 +182,22 @@ public object MappingProcessor {
} catch (e: Exception) {
injector.messages.showStatusBarMessage(editor, e.message)
injector.messages.indicateError()
log.warn(
log.error(
"""
Caught exception during ${mappingInfo.getPresentableString()}
${e.message}
""".trimIndent(),
e
)
} catch (e: NotImplementedError) {
injector.messages.showStatusBarMessage(editor, e.message)
injector.messages.indicateError()
log.warn(
log.error(
"""
Caught exception during ${mappingInfo.getPresentableString()}
${e.message}
""".trimIndent(),
e
)
} finally {
mappingState.stopMapExecution()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public interface VimLogger {

public fun warn(message: String)
public fun error(message: String)
public fun error(message: String, e: Throwable)
public fun info(message: String)
}

Expand Down

0 comments on commit 8c06767

Please sign in to comment.