Skip to content

Exception instance for SomeAsyncException should define displayException #309

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

Closed
alt-romes opened this issue Nov 26, 2024 · 8 comments
Closed
Labels
approved Approved by CLC vote base-4.22 Implemented in base-4.22 (GHC 9.14)

Comments

@alt-romes
Copy link

The instance for SomeAsyncException is currently is currently defined as

-- | @since base-4.7.0.0
instance Exception SomeAsyncException

with an empty implementation.
This means that if the wrapped exception has a custom displayException definition, that definition is lost.Given that the Show instance simply omits the SomeAsyncException wrapper, perhaps a reasonable definition would be:

instance Exception SomeAsyncException where
  displayException (SomeExceptionException e) = displayException e

We propose to update the instance Exception SomeAsyncException to the snippet above.

Originally by @edsko on the GHC issue tracker.

@parsonsmatt
Copy link

Yes please! Great catch

@alt-romes
Copy link
Author

Perhaps this can be moved along? @Bodigrim what do you think?

@Bodigrim
Copy link
Collaborator

Yes, seems uncontroversial to me: we unpack e in instance Exception SomeException, we should do the same for SomeAsyncException.

Dear CLC members, as an exception, given that the proposed change is very simple, holidays are looming and I trust @alt-romes to create a GHC MR promptly, let's vote on it without waiting for MR.

@tomjaguarpaw @parsonsmatt @angerman @hasufell @velveteer @mixphix

+1 from me.

@Bodigrim Bodigrim added the vote-in-progress The CLC vote is in progress label Dec 14, 2024
@alt-romes
Copy link
Author

I had forgotten about preparing an MR, but promptly made one now

https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13725

Thanks @Bodigrim

@hasufell
Copy link
Member

+1

2 similar comments
@tomjaguarpaw
Copy link
Member

+1

@parsonsmatt
Copy link

+1

@Bodigrim
Copy link
Collaborator

Thanks all, that's enough votes to approve.

@Bodigrim Bodigrim added approved Approved by CLC vote and removed vote-in-progress The CLC vote is in progress labels Dec 14, 2024
@Bodigrim Bodigrim added the base-4.22 Implemented in base-4.22 (GHC 9.14) label Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Approved by CLC vote base-4.22 Implemented in base-4.22 (GHC 9.14)
Projects
None yet
Development

No branches or pull requests

5 participants