Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
plausible-analytics
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
varac-projects
plausible-analytics
Commits
e1bb4368
Commit
e1bb4368
authored
Apr 19, 2021
by
Uku Taht
Browse files
Options
Downloads
Patches
Plain Diff
Show better error message when changing plans fails
parent
ba6b897f
Branches
Branches containing commit
Tags
schleuder-3.0.0.beta10
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/plausible_web/controllers/billing_controller.ex
+14
-0
14 additions, 0 deletions
lib/plausible_web/controllers/billing_controller.ex
with
14 additions
and
0 deletions
lib/plausible_web/controllers/billing_controller.ex
+
14
−
0
View file @
e1bb4368
...
@@ -47,9 +47,23 @@ defmodule PlausibleWeb.BillingController do
...
@@ -47,9 +47,23 @@ defmodule PlausibleWeb.BillingController do
|>
redirect
(
to:
"/settings"
)
|>
redirect
(
to:
"/settings"
)
{
:error
,
e
}
->
{
:error
,
e
}
->
# https://developer.paddle.com/api-reference/intro/api-error-codes
msg
=
case
e
do
%{
"code"
=>
147
}
->
"We were unable to charge your card. Make sure your payment details are up to date and try again."
%{
"message"
=>
msg
}
when
not
is_nil
(
msg
)
->
msg
_
->
"Something went wrong. Please try again or contact support at support@plausible.io"
end
Sentry
.
capture_message
(
"Error changing plans"
,
Sentry
.
capture_message
(
"Error changing plans"
,
extra:
%{
extra:
%{
errors:
inspect
(
e
),
errors:
inspect
(
e
),
message:
msg
,
new_plan_id:
new_plan_id
,
new_plan_id:
new_plan_id
,
user_id:
conn
.
assigns
[
:current_user
]
.
id
user_id:
conn
.
assigns
[
:current_user
]
.
id
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment