Skip to content

Commit

Permalink
feat: add external upgrade plan link to error notification
Browse files Browse the repository at this point in the history
  • Loading branch information
carlrobertoh committed Jun 30, 2024
1 parent 9b716a4 commit ae63156
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package ee.carlrobert.codegpt.actions.editor

import com.intellij.ide.BrowserUtil
import com.intellij.notification.NotificationAction
import com.intellij.notification.NotificationType
import com.intellij.openapi.application.runInEdt
import com.intellij.openapi.application.runUndoTransparentWriteAction
Expand Down Expand Up @@ -37,9 +39,13 @@ class EditCodeCompletionListener(

override fun onError(error: ErrorDetails, ex: Throwable) {
observableProperties.loading.set(false)

OverlayUtil.showNotification(
"Something went wrong while requesting completion. Please try again.",
NotificationType.ERROR
error.message,
NotificationType.ERROR,
NotificationAction.createSimpleExpiring("Upgrade plan") {
BrowserUtil.open("https://codegpt.ee/#pricing")
},
)
}

Expand Down

0 comments on commit ae63156

Please sign in to comment.