Skip to content
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

Feat/more protocol #155

Merged
merged 53 commits into from
Nov 9, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
11f62b6
add sentry protocol Request
rxlabz Oct 30, 2020
a237e0c
add sentry protocol Mechanism
rxlabz Oct 30, 2020
5c4c83d
fix helpLInk serialization key
rxlabz Nov 2, 2020
9065f48
use dynamic instead of Object
rxlabz Nov 2, 2020
cd3a749
add SentryException, SentryStrackTrace and SentryStackFrame
rxlabz Nov 2, 2020
f03bce5
add SentryExceptionFactory and SentryStrackTraceFactory
rxlabz Nov 2, 2020
93b98bc
feedbacks
rxlabz Nov 3, 2020
8dd353f
event throwable & stacktrace
rxlabz Nov 3, 2020
f84b1ec
- add a default stacktrace factory
rxlabz Nov 3, 2020
a2a9e9c
fix stackFrame lineNo & colNo case and type
rxlabz Nov 4, 2020
a1c1966
do not expose the stacktraceFactory
rxlabz Nov 4, 2020
efacef6
make SentryException fields final
rxlabz Nov 4, 2020
92f3ae5
- make SentryStackFrame immutable
rxlabz Nov 4, 2020
5b9065a
immutable SentryStackTrace
rxlabz Nov 4, 2020
5589888
SentryStackTrace.copyWith
rxlabz Nov 4, 2020
8fdafa5
SentryStackTraceFactory : docs and @visibleForTesting encodeStackTrac…
rxlabz Nov 5, 2020
0430bb5
remove origin field
rxlabz Nov 5, 2020
6eac349
SentryStackFrame.copyWith
rxlabz Nov 5, 2020
0a00d78
- immutable Mechanism
rxlabz Nov 5, 2020
b83c975
minor
rxlabz Nov 5, 2020
18a61e7
feedbacks
rxlabz Nov 5, 2020
ae98e29
Merge remote-tracking branch 'origin/main' into feat/more-protocol
rxlabz Nov 5, 2020
9772d29
immutable request
rxlabz Nov 5, 2020
f288106
immutable request.data if list or map
rxlabz Nov 5, 2020
0549a07
not override event.exception
rxlabz Nov 5, 2020
3ae8f50
- SentryStackTraceFactory : add _inAppExcludes & _inAppExcludes
rxlabz Nov 5, 2020
fe5f517
isInApp(frame.uri.scheme)
rxlabz Nov 5, 2020
2853bfc
SentryStackTraceFactory.isInApp
rxlabz Nov 5, 2020
ca307e0
SentryStackTraceFactory.isInApp & fix tests
rxlabz Nov 5, 2020
fa050f5
isInApp verification order
rxlabz Nov 5, 2020
ac07436
- add DebugMeta, DebugImage, SdkInfo classes
rxlabz Nov 6, 2020
76927a4
add SentryEvent.debugMeta
rxlabz Nov 6, 2020
f142a1b
add 'Sentry prefix' where missing
rxlabz Nov 6, 2020
4119eea
rename "exception" argument to "throwable"
rxlabz Nov 6, 2020
dabf285
add a sentryException to SentryClient ctor
rxlabz Nov 6, 2020
fcb2767
not send lineNo or ColNo < 0 + changelog
rxlabz Nov 6, 2020
eed8ddc
fix tests
rxlabz Nov 6, 2020
78894e0
non nullable options
rxlabz Nov 6, 2020
28ceb93
non nullable options in exception and stacktrace factories
rxlabz Nov 6, 2020
cc0327c
exception serialization
rxlabz Nov 6, 2020
1055820
ArgumentError.notNull to ArgumentError(msg)
rxlabz Nov 6, 2020
317eb6f
fix tests
rxlabz Nov 6, 2020
6e43709
add tests and fixes
rxlabz Nov 9, 2020
a814692
fix tests
rxlabz Nov 9, 2020
2898047
add debug meta serialization test
rxlabz Nov 9, 2020
25e42e8
add inApp includes & excludes tests
rxlabz Nov 9, 2020
7397402
add inApp includes precedence test + doc
rxlabz Nov 9, 2020
6f445cc
tests description rewording
rxlabz Nov 9, 2020
3719ed3
null pointer
rxlabz Nov 9, 2020
6f1babb
event.stacktrace should not be override test
rxlabz Nov 9, 2020
7d0c017
add event.stacktrace tests
rxlabz Nov 9, 2020
f63cd73
feedback : fix imports
rxlabz Nov 9, 2020
bf134b8
fix imports
rxlabz Nov 9, 2020
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
80 changes: 80 additions & 0 deletions dart/lib/src/protocol/mechanism.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/// Sentry Exception Mechanism
/// The exception mechanism is an optional field residing
/// in the Exception Interface. It carries additional information about
/// the way the exception was created on the target system.
/// This includes general exception values obtained from operating system or
/// runtime APIs, as well as mechanism-specific values.
class Mechanism {
/// Required unique identifier of this mechanism determining rendering and processing of the mechanism data
/// The type attribute is required to send any exception mechanism attribute,
/// even if the SDK cannot determine the specific mechanism.
/// In this case, set the type to "generic". See below for an example.
final String type;

/// Optional human readable description of the error mechanism and a possible hint on how to solve this error
final String description;

/// Optional fully qualified URL to an online help resource, possible interpolated with error parameters
final String helpLink;

/// Optional flag indicating whether the exception has been handled by the user (e.g. via try..catch)
final bool handled;

/// Optional information from the operating system or runtime on the exception mechanism
/// The mechanism meta data usually carries error codes reported by
/// the runtime or operating system, along with a platform dependent
/// interpretation of these codes. SDKs can safely omit code names and
/// descriptions for well known error codes, as it will be filled out by
/// Sentry. For proprietary or vendor-specific error codes,
/// adding these values will give additional information to the user.
final Map<String, Object> meta;

/// Arbitrary extra data that might help the user understand the error thrown by this mechanism
final Map<String, Object> data;

final bool synthetic;

Mechanism({
this.type,
this.description,
this.helpLink,
this.handled,
this.meta,
this.data,
this.synthetic,
});

Map<String, dynamic> toJson() {
final json = <String, dynamic>{};

if (type != null) {
json['type'] = type;
}

if (description != null) {
json['description'] = description;
}

if (helpLink != null) {
json['helpLink'] = helpLink;
}

if (handled != null) {
json['handled'] = handled;
}

if (meta != null && meta.isNotEmpty) {
json['meta'] = meta;
}

if (data != null && data.isNotEmpty) {
json['data'] = data;
}

if (synthetic != null) {
json['synthetic'] = synthetic;
}

return json;
}
}
84 changes: 84 additions & 0 deletions dart/lib/src/protocol/request.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
class Request {
///The URL of the request if available.
///The query string can be declared either as part of the url,
///or separately in queryString.
final String url;

///The HTTP method of the request.
final String method;

/// The query string component of the URL.
///
/// If the query string is not declared and part of the url parameter,
/// Sentry moves it to the query string.
final String queryString;

/// Submitted data in a format that makes the most sense.
/// SDKs should discard large bodies by default.
/// Can be given as string or structural data of any format.
final dynamic data;

/// The cookie values as string.
final String cookies;

/// A dictionary of submitted headers.
/// If a header appears multiple times it,
/// needs to be merged according to the HTTP standard for header merging.
/// Header names are treated case-insensitively by Sentry.
final Map<String, String> headers;

/// A dictionary containing environment information passed from the server.
/// This is where information such as CGI/WSGI/Rack keys go that are not HTTP headers.
final Map<String, String> env;

final Map<String, String> other;

Request({
this.url,
this.method,
this.queryString,
this.data,
this.cookies,
this.headers,
this.env,
this.other,
});

Map<String, dynamic> toJson() {
final json = <String, dynamic>{};

if (url != null) {
json['url'] = url;
}

if (method != null) {
json['method'] = method;
}

if (queryString != null) {
json['query_string'] = queryString;
}

if (data != null) {
json['data'] = data;
}

if (cookies != null) {
json['cookies'] = cookies;
}

if (headers != null && headers.isNotEmpty) {
json['headers'] = headers;
}

if (env != null && env.isNotEmpty) {
json['env'] = env;
}

if (other != null && other.isNotEmpty) {
json['other'] = other;
}

return json;
}
}