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

[JUJU-1339] Adds a shush method to the library and IsType. #59

Merged
merged 1 commit into from
Jun 21, 2022

Conversation

tlm
Copy link
Member

@tlm tlm commented Jun 19, 2022

Shush is responsible for making an error silent in fmt output.
Specifically useful with fmt.Errorf when you want an error to be wrapped
but want its error message shushed.

IsType is a convenience method for checking a more complex error is of
type x within it's change. This is for cases where errors.Is can't be
used and where errors.As is not needed for the actual error type.

functions.go Outdated Show resolved Hide resolved
@tlm
Copy link
Member Author

tlm commented Jun 20, 2022

/build

2 similar comments
@tlm
Copy link
Member Author

tlm commented Jun 20, 2022

/build

@tlm
Copy link
Member Author

tlm commented Jun 20, 2022

/build

Copy link
Member

@wallyworld wallyworld left a comment

Choose a reason for hiding this comment

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

Agree with Jordan, can we think of a better, non colloquial term

@tlm tlm force-pushed the shush-errors branch 2 times, most recently from 238bd8e to 83c1c25 Compare June 21, 2022 05:34
@tlm tlm changed the title [JUJU-1339] Adds a shush method to the library. [JUJU-1339] Adds a shush method to the library and IsType. Jun 21, 2022
Copy link
Member

@wallyworld wallyworld left a comment

Choose a reason for hiding this comment

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

I'd like to see us avoid the panic before landing.

functions.go Outdated Show resolved Hide resolved
functions.go Outdated Show resolved Hide resolved
Hide is responsible for making an error silent in fmt output.
Specifically useful with fmt.Errorf when you want an error to be wrapped
but want it's error message shushed.

IsType is a convenience method for checking a more complex error is of
type x within it's change. This is for cases where errors.Is can't be
used and where errors.As is not needed for the actual error type.
@tlm tlm merged commit 0ebb696 into juju:master Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants