Skip to content

Conversation

@rjrjr
Copy link
Collaborator

@rjrjr rjrjr commented Jun 13, 2025

Uses Throwable.withKey in a few more choke points, to break up crash reporter kitchen sinks. Had to make a few internal core methods public to allow their use from the android modules, but I think that's okay -- they're still in a package named internal, our intent should be clear.

@rjrjr rjrjr marked this pull request as ready for review June 17, 2025 16:08
@rjrjr rjrjr requested review from a team and zach-klippenstein as code owners June 17, 2025 16:08

/**
* Like Kotlin's [requireNotNull], but uses [stackTraceKey] to create a fake top element
* on the stack trace, ensuring that BugSnag's default grouping will create unique
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: You could generalize this to "any crash reporter that uses stacktrace" rather than particular Bugsnag.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, accidental copy paste from the internal method.

* @throws IllegalArgumentException if the [value] is false.
*/
@OptIn(ExperimentalContracts::class)
inline fun <T : Any> requireNotNullWithKey(
Copy link
Contributor

Choose a reason for hiding this comment

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

i think you'll have to mark this public for explicit API mode, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yup. I wonder why the build didn't catch that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oooh, I wonder if we turned off that check for internal package. If so I think I can undo the other explicit publics I added in here. Trying it out…

@rjrjr rjrjr enabled auto-merge June 17, 2025 19:40
@rjrjr rjrjr force-pushed the ray/more-exception-detangling branch from 6ab9934 to 2e1add9 Compare June 17, 2025 19:55
Uses `Throwable.withKey` in a few more choke points, to break up crash reporter kitchen sinks. Had to make a few `internal` core methods public to allow their use from the android modules, but I think that's okay -- they're still in a package named `internal`, our intent should be clear.
@rjrjr rjrjr force-pushed the ray/more-exception-detangling branch from 2e1add9 to 0495048 Compare June 17, 2025 21:56
@rjrjr rjrjr merged commit c789f9b into main Jun 17, 2025
43 checks passed
@rjrjr rjrjr deleted the ray/more-exception-detangling branch June 17, 2025 22:20
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