Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
f1c4417
feat(event) implement ErrorOptions and CaptureOptions class
YYChen01988 Nov 10, 2025
fcc3561
test(event) error options end to end tests
YYChen01988 Nov 25, 2025
ab7b1ee
refactor(CaptureOptions): inverted and simplified the `excludeStacktr…
lemnik Dec 1, 2025
7dde678
refactor(CaptureOptions): renamed `CaptureOptions` to `ErrorCaptureOp…
lemnik Dec 2, 2025
697444e
refactor(ErrorCaptureOptions): Changed the order of the ErrorCaptureO…
lemnik Dec 2, 2025
4f7e775
feat(Client): Added notify(Throwable, ErrorOptions) to Client & Bugsnag
lemnik Dec 2, 2025
75cf5ae
test(ErrorOptions): added a more complete e2e test suite for ErrorCap…
lemnik Dec 2, 2025
c6ed145
chore(lint): fixed lint errors
lemnik Dec 2, 2025
8199205
refactor(Client): removed the `notify(Throwable, ErrorOptions)` from …
lemnik Dec 2, 2025
b4d19ee
test(ErrorOptions): fixed the stacktrace check in End-to-end tests
lemnik Dec 2, 2025
d56bbfe
chore(gem): add openssl to Gemfile
lemnik Dec 2, 2025
f9e1af4
chore(example): removed the ErrorOptions from the example app
lemnik Dec 2, 2025
37d8be8
test(ErrorCaptureOptions): added a test for all possible bit fields u…
lemnik Dec 2, 2025
3c876a4
refactor(Client.notify): further simplified the `notify(Throwable, Er…
lemnik Dec 2, 2025
78b1c00
test(e2e): added stacktrace null checks to all non-stacktrace scenari…
lemnik Dec 3, 2025
ebb31a8
chore(Error): refactored `Error.createError` to follow the same order…
lemnik Dec 3, 2025
0a646e5
test(e2e): additional custom metadata capturing checks
lemnik Dec 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ gem 'bugsnag-maze-runner', '~>10.0'
#gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner'

gem "license_finder", "~> 7.0"

gem "openssl", "~> 3.3"
44 changes: 44 additions & 0 deletions bugsnag-android-core/api/bugsnag-android-core.api
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public final class com/bugsnag/android/Bugsnag {
public static fun leaveBreadcrumb (Ljava/lang/String;Ljava/util/Map;Lcom/bugsnag/android/BreadcrumbType;)V
public static fun markLaunchCompleted ()V
public static fun notify (Ljava/lang/Throwable;)V
public static fun notify (Ljava/lang/Throwable;Lcom/bugsnag/android/ErrorOptions;Lcom/bugsnag/android/OnErrorCallback;)V
public static fun notify (Ljava/lang/Throwable;Lcom/bugsnag/android/OnErrorCallback;)V
public static fun pauseSession ()V
public static fun removeOnBreadcrumb (Lcom/bugsnag/android/OnBreadcrumbCallback;)V
Expand Down Expand Up @@ -139,6 +140,7 @@ public class com/bugsnag/android/Client : com/bugsnag/android/CallbackAware, com
public fun leaveBreadcrumb (Ljava/lang/String;Ljava/util/Map;Lcom/bugsnag/android/BreadcrumbType;)V
public fun markLaunchCompleted ()V
public fun notify (Ljava/lang/Throwable;)V
public fun notify (Ljava/lang/Throwable;Lcom/bugsnag/android/ErrorOptions;Lcom/bugsnag/android/OnErrorCallback;)V
public fun notify (Ljava/lang/Throwable;Lcom/bugsnag/android/OnErrorCallback;)V
public fun pauseSession ()V
public fun removeOnBreadcrumb (Lcom/bugsnag/android/OnBreadcrumbCallback;)V
Expand Down Expand Up @@ -355,6 +357,48 @@ public class com/bugsnag/android/Error : com/bugsnag/android/JsonStream$Streamab
public fun toStream (Lcom/bugsnag/android/JsonStream;)V
}

public final class com/bugsnag/android/ErrorCaptureOptions {
public static final field CAPTURE_BREADCRUMBS I
public static final field CAPTURE_FEATURE_FLAGS I
public static final field CAPTURE_STACKTRACE I
public static final field CAPTURE_THREADS I
public static final field CAPTURE_USER I
public static final field Companion Lcom/bugsnag/android/ErrorCaptureOptions$Companion;
public fun <init> ()V
public fun <init> (ZZZZZLjava/util/Set;)V
public synthetic fun <init> (ZZZZZLjava/util/Set;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public static final fun captureNothing ()Lcom/bugsnag/android/ErrorCaptureOptions;
public static final fun captureOnly (I)Lcom/bugsnag/android/ErrorCaptureOptions;
public static final fun captureOnly (ILjava/util/Set;)Lcom/bugsnag/android/ErrorCaptureOptions;
public final fun getBreadcrumbs ()Z
public final fun getFeatureFlags ()Z
public final fun getMetadata ()Ljava/util/Set;
public final fun getStacktrace ()Z
public final fun getThreads ()Z
public final fun getUser ()Z
public final fun setBreadcrumbs (Z)V
public final fun setFeatureFlags (Z)V
public final fun setMetadata (Ljava/util/Set;)V
public final fun setStacktrace (Z)V
public final fun setThreads (Z)V
public final fun setUser (Z)V
}

public final class com/bugsnag/android/ErrorCaptureOptions$Companion {
public final fun captureNothing ()Lcom/bugsnag/android/ErrorCaptureOptions;
public final fun captureOnly (I)Lcom/bugsnag/android/ErrorCaptureOptions;
public final fun captureOnly (ILjava/util/Set;)Lcom/bugsnag/android/ErrorCaptureOptions;
public static synthetic fun captureOnly$default (Lcom/bugsnag/android/ErrorCaptureOptions$Companion;ILjava/util/Set;ILjava/lang/Object;)Lcom/bugsnag/android/ErrorCaptureOptions;
}

public final class com/bugsnag/android/ErrorOptions {
public fun <init> ()V
public fun <init> (Lcom/bugsnag/android/ErrorCaptureOptions;)V
public synthetic fun <init> (Lcom/bugsnag/android/ErrorCaptureOptions;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun getCapture ()Lcom/bugsnag/android/ErrorCaptureOptions;
public final fun setCapture (Lcom/bugsnag/android/ErrorCaptureOptions;)V
}

public final class com/bugsnag/android/ErrorType : java/lang/Enum {
public static final field ANDROID Lcom/bugsnag/android/ErrorType;
public static final field C Lcom/bugsnag/android/ErrorType;
Expand Down
2 changes: 1 addition & 1 deletion bugsnag-android-core/detekt-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<ID>LongParameterList:DeviceWithState.kt$DeviceWithState$( buildInfo: DeviceBuildInfo, jailbroken: Boolean?, id: String?, locale: String?, totalMemory: Long?, runtimeVersions: MutableMap&lt;String, Any>, /** * The number of free bytes of storage available on the device */ var freeDisk: Long?, /** * The number of free bytes of memory available on the device */ var freeMemory: Long?, /** * The orientation of the device when the event occurred: either portrait or landscape */ var orientation: String?, /** * The timestamp on the device when the event occurred */ var time: Date? )</ID>
<ID>LongParameterList:EventFilenameInfo.kt$EventFilenameInfo.Companion$( obj: Any, uuid: String = UUID.randomUUID().toString(), apiKey: String?, timestamp: Long = System.currentTimeMillis(), config: ImmutableConfig, isLaunching: Boolean? = null )</ID>
<ID>LongParameterList:EventInternal.kt$EventInternal$( apiKey: String, logger: Logger, breadcrumbs: MutableList&lt;Breadcrumb> = mutableListOf(), discardClasses: Set&lt;Pattern> = setOf(), errors: MutableList&lt;Error> = mutableListOf(), metadata: Metadata = Metadata(), featureFlags: FeatureFlags = FeatureFlags(), originalError: Throwable? = null, projectPackages: Collection&lt;String> = setOf(), severityReason: SeverityReason = SeverityReason.newInstance(SeverityReason.REASON_HANDLED_EXCEPTION), threads: MutableList&lt;Thread> = mutableListOf(), user: User = User(), redactionKeys: Set&lt;Pattern>? = null, isAttemptDeliveryOnCrash: Boolean = false )</ID>
<ID>LongParameterList:EventInternal.kt$EventInternal$( originalError: Throwable? = null, config: ImmutableConfig, severityReason: SeverityReason, data: Metadata = Metadata(), featureFlags: FeatureFlags = FeatureFlags(), captureStacktrace: Boolean = true, captureThreads: Boolean = true, )</ID>
<ID>LongParameterList:EventStorageModule.kt$EventStorageModule$( contextModule: ContextModule, configModule: ConfigModule, dataCollectionModule: DataCollectionModule, bgTaskService: BackgroundTaskService, trackerModule: TrackerModule, systemServiceModule: SystemServiceModule, notifier: Notifier, callbackState: CallbackState )</ID>
<ID>LongParameterList:NativeStackframe.kt$NativeStackframe$( /** * The name of the method that was being executed */ var method: String?, /** * The location of the source file */ var file: String?, /** * The line number within the source file this stackframe refers to */ var lineNumber: Number?, /** * The address of the instruction where the event occurred. */ var frameAddress: Long?, /** * The address of the function where the event occurred. */ var symbolAddress: Long?, /** * The address of the library where the event occurred. */ var loadAddress: Long?, /** * Whether this frame identifies the program counter */ var isPC: Boolean?, /** * The type of the error */ var type: ErrorType? = null, /** * Identifies the exact build this frame originates from. */ var codeIdentifier: String? = null, )</ID>
<ID>LongParameterList:StateEvent.kt$StateEvent.Install$( @JvmField val apiKey: String, @JvmField val autoDetectNdkCrashes: Boolean, @JvmField val appVersion: String?, @JvmField val buildUuid: String?, @JvmField val releaseStage: String?, @JvmField val lastRunInfoPath: String, @JvmField val consecutiveLaunchCrashes: Int, @JvmField val sendThreads: ThreadSendPolicy, @JvmField val maxBreadcrumbs: Int )</ID>
Expand Down Expand Up @@ -64,7 +65,6 @@
<ID>MagicNumber:JsonHelper.kt$JsonHelper$8</ID>
<ID>MagicNumber:JsonStream.kt$JsonStream$128</ID>
<ID>MagicNumber:JsonStream.kt$JsonStream$32</ID>
<ID>MagicNumber:JsonStream.kt$JsonStream.Companion$128</ID>
<ID>MagicNumber:LastRunInfoStore.kt$LastRunInfoStore$3</ID>
<ID>MagicNumber:SessionStore.kt$SessionStore$60</ID>
<ID>MaxLineLength:LastRunInfo.kt$LastRunInfo$return "LastRunInfo(consecutiveLaunchCrashes=$consecutiveLaunchCrashes, crashed=$crashed, crashedDuringLaunch=$crashedDuringLaunch)"</ID>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,20 @@ public static void notify(@NonNull final Throwable exception,
getClient().notify(exception, onError);
}

/**
* Notify Bugsnag of a handled exception
*
* @param exception the exception to send to Bugsnag
* @param options additional options to adjust the reporting of the exception
* @param onError callback invoked on the generated error report for
* additional modification
*/
public static void notify(@NonNull final Throwable exception,
@Nullable final ErrorOptions options,
@Nullable final OnErrorCallback onError) {
getClient().notify(exception, options, onError);
}

/**
* Adds a map of multiple metadata key-value pairs to the specified section.
*/
Expand Down
Loading
Loading