Skip to content

Commit

Permalink
fix(action): set error as commit message (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
Blarc committed Jun 17, 2023
1 parent af0596e commit ac2f204
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Changelog

## [Unreleased]
### Fixed
- Set error message as commit message when OpenAI API returns error, because notification seems unreliable.

## [1.2.0] - 2023-06-15

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pluginGroup = com.github.blarc
pluginName = AICommits
pluginRepositoryUrl = https://github.com/Blarc/ai-commits-intellij-plugin
# SemVer format -> https://semver.org
pluginVersion = 1.2.0
pluginVersion = 1.2.1

# https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild = 231
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class AICommitAction : AnAction(), DumbAware {
commitMessage.setCommitMessage(generatedCommitMessage)
AppSettings.instance.recordHit()
} catch (e: Exception) {
commitMessage.setCommitMessage(message("action.error"))
commitMessage.setCommitMessage(e.message ?: message("action.error"))
sendNotification(Notification.unsuccessfulRequest(e.message ?: message("action.unknown-error")))
}
}
Expand Down

0 comments on commit ac2f204

Please sign in to comment.