Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add passage error class #105

Merged
merged 37 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
21196d0
feat: deprecate fields and add new ones
tdeshong Nov 6, 2024
6024fe5
test: get user info
tdeshong Nov 8, 2024
58199d1
refactor: test by identifier
tdeshong Nov 8, 2024
3eebdd1
style: spacing
tdeshong Nov 8, 2024
4c8a30e
feat: get info by identifier test more explicit
tdeshong Nov 8, 2024
56aec6b
feat: get info by identifier test more explicit
tdeshong Nov 8, 2024
85e19e4
test: activate user
tdeshong Nov 8, 2024
c7b45fc
test: deactivate user
tdeshong Nov 8, 2024
925de58
test: update 401 asserts
tdeshong Nov 18, 2024
cd0fbf1
test: 401 user by identifier
tdeshong Nov 18, 2024
02823fa
test: update user
tdeshong Nov 18, 2024
db6a364
test: create user
tdeshong Nov 18, 2024
f71ace6
test: create user with metadata added to create user tests
tdeshong Nov 18, 2024
5b7da70
test: delete user
tdeshong Nov 18, 2024
2d2d960
test: list user devices
tdeshong Nov 18, 2024
71ae516
test: signout user
tdeshong Nov 18, 2024
79a129a
feat: network error improvement
tdeshong Nov 18, 2024
3cabc27
test: app user
tdeshong Nov 19, 2024
a76f464
test: update assert and spacing
tdeshong Nov 19, 2024
968157a
test: case for invalid access token
tdeshong Nov 19, 2024
bb1d22e
style: format
tdeshong Nov 19, 2024
b5f24cd
feat: new PassageError
tdeshong Nov 21, 2024
4169d32
style: lint + format
tdeshong Nov 21, 2024
eae8144
doc: deprecation on error
tdeshong Nov 22, 2024
c05f8b4
feat: use error message from api
tdeshong Nov 22, 2024
04cb184
feat: network passage error
tdeshong Nov 22, 2024
24b935e
chore: clean up
tdeshong Nov 22, 2024
bb02df6
feat: update error messgae for org endpoints refactor v2
tdeshong Nov 22, 2024
24d1619
feat: error code getapp
tdeshong Nov 22, 2024
758e2e1
chore: no lint
tdeshong Nov 22, 2024
5b89243
chore: typo
tdeshong Nov 22, 2024
e2695c6
Merge branch 'main' into PSG-4995-error-test
tdeshong Nov 22, 2024
d766251
chore: remove unused files
ctran88 Nov 22, 2024
d925861
style: fix linting issues when checking for error type
ctran88 Nov 22, 2024
6dafa6d
fix: adds missing error code to create magic link function
ctran88 Nov 22, 2024
07b16b0
style: reorder fields
ctran88 Nov 22, 2024
94ce141
test: adds error code to assertions
ctran88 Nov 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,19 @@ func (a *App) CreateMagicLink(createMagicLinkBody CreateMagicLinkBody) (*MagicLi
}

var errorText string
var errorCode string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this also be set for GetApp as well so that its error struct is populated for those that are not ready to move to the major version yet?

switch {
case res.JSON400 != nil:
errorCode = string(res.JSON400.Code)
errorText = res.JSON400.Error
case res.JSON401 != nil:
errorCode = string(res.JSON401.Code)
errorText = res.JSON401.Error
case res.JSON404 != nil:
errorCode = string(res.JSON404.Code)
errorText = res.JSON404.Error
case res.JSON500 != nil:
errorCode = string(res.JSON500.Code)
errorText = res.JSON500.Error
}

Expand All @@ -123,5 +128,6 @@ func (a *App) CreateMagicLink(createMagicLinkBody CreateMagicLinkBody) (*MagicLi
StatusCode: res.StatusCode(),
StatusText: res.Status(),
ErrorText: errorText,
ErrorCode: errorCode,
}
}
Loading