-
Notifications
You must be signed in to change notification settings - Fork 207
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
More open Event model #2060
More open Event model #2060
Changes from 10 commits
4ab6036
5318a3a
8a07637
ec529a8
1785484
ba232b2
5117db0
ba1c5fc
9f73257
3b874f9
08526ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -51,8 +51,8 @@ private void logNull(String property) { | |||||||||
} | ||||||||||
|
||||||||||
/** | ||||||||||
* The Throwable object that caused the event in your application. | ||||||||||
* | ||||||||||
* The {@link Throwable} object that caused the event in your application. | ||||||||||
* <p> | ||||||||||
YYChen01988 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
* Manipulating this field does not affect the error information reported to the | ||||||||||
* Bugsnag dashboard. Use {@link Event#getErrors()} to access and amend the representation of | ||||||||||
* the error that will be sent. | ||||||||||
|
@@ -66,7 +66,7 @@ public Throwable getOriginalError() { | |||||||||
* Information extracted from the {@link Throwable} that caused the event can be found in this | ||||||||||
* field. The list contains at least one {@link Error} that represents the thrown object | ||||||||||
* with subsequent elements in the list populated from {@link Throwable#getCause()}. | ||||||||||
* | ||||||||||
* <p> | ||||||||||
* A reference to the actual {@link Throwable} object that caused the event is available | ||||||||||
* through {@link Event#getOriginalError()} ()}. | ||||||||||
*/ | ||||||||||
|
@@ -75,6 +75,35 @@ public List<Error> getErrors() { | |||||||||
return impl.getErrors(); | ||||||||||
} | ||||||||||
|
||||||||||
/** | ||||||||||
* Add a new error to this report and return its Error data. The new Error will appear at the | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
* end of the {@link #getErrors() errors list}. | ||||||||||
*/ | ||||||||||
@NonNull | ||||||||||
public Error addError(@NonNull Throwable error) { | ||||||||||
return impl.addError(error); | ||||||||||
} | ||||||||||
|
||||||||||
/** | ||||||||||
* Add a new empty {@link ErrorType#ANDROID android} error to this report and return its Error | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
* data. The new Error will appear at the end of the {@link #getErrors() errors list}. | ||||||||||
*/ | ||||||||||
@NonNull | ||||||||||
public Error addError(@NonNull String errorClass, @Nullable String errorMessage) { | ||||||||||
return impl.addError(errorClass, errorMessage, ErrorType.ANDROID); | ||||||||||
} | ||||||||||
|
||||||||||
/** | ||||||||||
* Add a new empty error to this report and return its Error data. The new Error will appear | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
* at the end of the {@link #getErrors() errors list}. | ||||||||||
*/ | ||||||||||
@NonNull | ||||||||||
public Error addError(@NonNull String errorClass, | ||||||||||
@Nullable String errorMessage, | ||||||||||
@NonNull ErrorType errorType) { | ||||||||||
return impl.addError(errorClass, errorMessage, errorType); | ||||||||||
} | ||||||||||
|
||||||||||
/** | ||||||||||
* If thread state is being captured along with the event, this field will contain a | ||||||||||
* list of {@link Thread} objects. | ||||||||||
|
@@ -84,6 +113,46 @@ public List<Thread> getThreads() { | |||||||||
return impl.getThreads(); | ||||||||||
} | ||||||||||
|
||||||||||
/** | ||||||||||
* Create, add and return a new empty {@link Thread} object to this event with a given id | ||||||||||
* and name. This can be used to augment the report with thread data that would not be picked | ||||||||||
* up as part of a normal report being generated (for example: native threads managed | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
* by cross-platform toolkits). | ||||||||||
* | ||||||||||
* @return a new Thread object of type {@link ErrorType#ANDROID} with no stacktrace | ||||||||||
*/ | ||||||||||
@NonNull | ||||||||||
public Thread addThread(@NonNull String id, | ||||||||||
@NonNull String name) { | ||||||||||
return impl.addThread( | ||||||||||
id, | ||||||||||
name, | ||||||||||
ErrorType.ANDROID, | ||||||||||
false, | ||||||||||
Thread.State.RUNNABLE.getDescriptor() | ||||||||||
); | ||||||||||
} | ||||||||||
|
||||||||||
/** | ||||||||||
* Create, add and return a new empty {@link Thread} object to this event with a given id | ||||||||||
* and name. This can be used to augment the report with thread data that would not be picked | ||||||||||
* up as part of a normal report being generated (for example: native threads managed | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
* by cross-platform toolkits). | ||||||||||
* | ||||||||||
* @return a new Thread object of type {@link ErrorType#ANDROID} with no stacktrace | ||||||||||
*/ | ||||||||||
@NonNull | ||||||||||
public Thread addThread(long id, | ||||||||||
@NonNull String name) { | ||||||||||
return impl.addThread( | ||||||||||
Long.toString(id), | ||||||||||
name, | ||||||||||
ErrorType.ANDROID, | ||||||||||
false, | ||||||||||
Thread.State.RUNNABLE.getDescriptor() | ||||||||||
); | ||||||||||
} | ||||||||||
|
||||||||||
/** | ||||||||||
* A list of breadcrumbs leading up to the event. These values can be accessed and amended | ||||||||||
* if necessary. See {@link Breadcrumb} for details of the data available. | ||||||||||
|
@@ -93,6 +162,26 @@ public List<Breadcrumb> getBreadcrumbs() { | |||||||||
return impl.getBreadcrumbs(); | ||||||||||
} | ||||||||||
|
||||||||||
/** | ||||||||||
* Add a new breadcrumb to this event and return its Breadcrumb object. The new breadcrumb | ||||||||||
* will be added to the end of the {@link #getBreadcrumbs() breadcrumbs list} by this method. | ||||||||||
*/ | ||||||||||
@NonNull | ||||||||||
public Breadcrumb leaveBreadcrumb(@NonNull String message, | ||||||||||
@NonNull BreadcrumbType type, | ||||||||||
@Nullable Map<String, Object> metadata) { | ||||||||||
return impl.leaveBreadcrumb(message, type, metadata); | ||||||||||
} | ||||||||||
|
||||||||||
/** | ||||||||||
* Add a new breadcrumb to this event and return its Breadcrumb object. The new breadcrumb | ||||||||||
* will be added to the end of the {@link #getBreadcrumbs() breadcrumbs list} by this# method. | ||||||||||
*/ | ||||||||||
@NonNull | ||||||||||
public Breadcrumb leaveBreadcrumb(@NonNull String message) { | ||||||||||
return impl.leaveBreadcrumb(message, BreadcrumbType.MANUAL, null); | ||||||||||
} | ||||||||||
|
||||||||||
/** | ||||||||||
* A list of feature flags active at the time of the event. | ||||||||||
* See {@link FeatureFlag} for details of the data available. | ||||||||||
|
@@ -167,7 +256,7 @@ public Severity getSeverity() { | |||||||||
* All events with the same grouping hash will be grouped together into one error. This is an | ||||||||||
* advanced usage of the library and mis-using it will cause your events not to group properly | ||||||||||
* in your dashboard. | ||||||||||
* | ||||||||||
* <p> | ||||||||||
* As the name implies, this option accepts a hash of sorts. | ||||||||||
*/ | ||||||||||
public void setGroupingHash(@Nullable String groupingHash) { | ||||||||||
|
@@ -179,7 +268,7 @@ public void setGroupingHash(@Nullable String groupingHash) { | |||||||||
* All events with the same grouping hash will be grouped together into one error. This is an | ||||||||||
* advanced usage of the library and mis-using it will cause your events not to group properly | ||||||||||
* in your dashboard. | ||||||||||
* | ||||||||||
* <p> | ||||||||||
* As the name implies, this option accepts a hash of sorts. | ||||||||||
*/ | ||||||||||
@Nullable | ||||||||||
|
@@ -388,7 +477,7 @@ public void setUnhandled(boolean unhandled) { | |||||||||
* using bugsnag-android-performance, but can also be set manually if required. | ||||||||||
* | ||||||||||
* @param traceId the ID of the trace the event occurred within | ||||||||||
* @param spanId the ID of the span that the event occurred within | ||||||||||
* @param spanId the ID of the span that the event occurred within | ||||||||||
*/ | ||||||||||
public void setTraceCorrelation(@NonNull UUID traceId, long spanId) { | ||||||||||
if (traceId != null) { | ||||||||||
|
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.