-
-
Notifications
You must be signed in to change notification settings - Fork 246
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
feature : static SDK main entry withSentry.init(options),... #108
Conversation
…ureEvent(...), .captureException(...)
dart/lib/src/sentry.dart
Outdated
static Future<SentryResponse> captureEvent( | ||
Event event, { | ||
StackFrameFilter stackFrameFilter, | ||
}) async { | ||
return _client.captureEvent( | ||
event: event, | ||
stackFrameFilter: stackFrameFilter, | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
our APIs return either a https://github.com/getsentry/sentry-java/blob/main/sentry/src/main/java/io/sentry/protocol/SentryId.java
or an empty SentryId
which is 00000000-0000-0000-0000-000000000000
I guess.
Also we never take a stackFrameFilter
as a param, we can work on this stuff later, but this will need to be changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should I rename the SentryResponse
class
sentry-dart/dart/lib/src/client.dart
Lines 234 to 256 in f63ac27
/// A response from Sentry.io. | |
/// | |
/// If [isSuccessful] the [eventId] field will contain the ID assigned to the | |
/// captured event by the Sentry.io backend. Otherwise, the [error] field will | |
/// contain the description of the error. | |
@immutable | |
class SentryResponse { | |
const SentryResponse.success({@required this.eventId}) | |
: isSuccessful = true, | |
error = null; | |
const SentryResponse.failure(this.error) | |
: isSuccessful = false, | |
eventId = null; | |
/// Whether event was submitted successfully. | |
final bool isSuccessful; | |
/// The ID Sentry.io assigned to the submitted event for future reference. | |
final String eventId; | |
/// Error message, if the response is not successful. | |
final String error; |
SentryId
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, not really, this is the whole response, we'd need to create a SentryId
class and inside of the client, we just read the uuid
out of the response and create a SentryId
with the proper uuid
, this doesn't need to be in this PR
…e/static-entry # Conflicts: # CHANGELOG.md
762545c
to
02d0918
Compare
…entry # Conflicts: # dart/lib/src/sentry_options.dart
…captureEvent(...), .captureException(...)
📢 Type of change
📜 Description
Add an Sentry class with static methods to init the sdk and capture the events.
💡 Motivation and Context
Sentry SDK unified API https://develop.sentry.dev/sdk/unified-api/#static-api
💚 How did you test it?
By checking if the internal client is correctly used when calling the static methods
📝 Checklist
🔮 Next steps
more static methods