-
-
Notifications
You must be signed in to change notification settings - Fork 241
CaptureFeedback now returns a SentryId #4613
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
Merged
Merged
Changes from 11 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
1a76177
CaptureFeedback now returns a SentryId
jamescrosswell 98bf2f6
Changelog
jamescrosswell f58417b
Update ApiApprovalTests.Run.Net4_8.verified.txt
jamescrosswell 04e9a56
Fixed client disposal
jamescrosswell 0cda3df
Merge remote-tracking branch 'origin/capture-feedback-return' into ca…
jamescrosswell 3d5e218
Added CaptureFeedbackResult
jamescrosswell 22da5b6
Merge branch 'version6' into capture-feedback-return
jamescrosswell 7824b1c
Updated docs/changelog
jamescrosswell 5041de0
Format code
getsentry-bot 4f2c694
Update ApiApprovalTests.Run.Net4_8.verified.txt
jamescrosswell 9db3a36
Merge branch 'capture-feedback-return' of https://github.com/getsentr…
jamescrosswell af76402
Fixed typo
jamescrosswell f412257
Review feedback
jamescrosswell 764193d
Merge branch 'version6' into capture-feedback-return
jamescrosswell 15ac236
Removed implicit operators
jamescrosswell 55e168d
Merge branch 'version6' into capture-feedback-return
jamescrosswell ea54e98
Update ApiApprovalTests.Run.Net4_8.verified.txt
jamescrosswell c738bc2
Merge branch 'version6' into capture-feedback-return
jamescrosswell 3070d9d
Changed to out param
jamescrosswell 9b5ce52
changelog
jamescrosswell 35c9685
Update ApiApprovalTests.Run.Net4_8.verified.txt
jamescrosswell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| namespace Sentry; | ||
|
|
||
| /// <summary> | ||
| /// The result type of the <see cref="ISentryClient.CaptureFeedback"/> method | ||
| /// </summary> | ||
| public struct CaptureFeedbackResult | ||
|
jamescrosswell marked this conversation as resolved.
Outdated
|
||
| { | ||
| /// <summary> | ||
| /// Creates a successful feedback capture result with the specified event Id. | ||
| /// </summary> | ||
| /// <param name="eventId"></param> | ||
| public CaptureFeedbackResult(SentryId eventId) | ||
| { | ||
| if (eventId == SentryId.Empty) | ||
| { | ||
| throw new ArgumentException("EventId cannot be empty", nameof(eventId)); | ||
| } | ||
|
|
||
| EventId = eventId; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Creates a failed feedback capture result with the specified error reason. | ||
| /// </summary> | ||
| /// <param name="errorReason"></param> | ||
| public CaptureFeedbackResult(CaptureFeedbackErrorReason errorReason) | ||
| { | ||
| EventId = SentryId.Empty; | ||
| ErrorReason = errorReason; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// The Id of the captured feedback, if successful. <see cref="SentryId.Empty"/> if feedback capture fails. | ||
| /// </summary> | ||
| public SentryId EventId; | ||
|
jamescrosswell marked this conversation as resolved.
Outdated
|
||
|
|
||
| /// <inheritdoc cref="CaptureFeedbackErrorReason"/> | ||
| public CaptureFeedbackErrorReason? ErrorReason; | ||
|
jamescrosswell marked this conversation as resolved.
Outdated
|
||
|
|
||
| /// <summary> | ||
| /// Implicitly converts a <see cref="CaptureFeedbackErrorReason"/> to a <see cref="CaptureFeedbackResult"/> | ||
| /// </summary> | ||
| /// <param name="errorReason"></param> | ||
| /// <returns></returns> | ||
| public static implicit operator CaptureFeedbackResult(CaptureFeedbackErrorReason errorReason) => new(errorReason); | ||
|
|
||
| /// <summary> | ||
| /// Implicitly converts a non-empty <see cref="SentryId"/> to a <see cref="CaptureFeedbackResult"/> | ||
| /// </summary> | ||
| /// <returns></returns> | ||
| public static implicit operator CaptureFeedbackResult(SentryId eventId) => new(eventId); | ||
|
|
||
| /// <summary> | ||
| /// Returns true if feedback capture was successful, false otherwise. | ||
| /// </summary> | ||
| public bool Succeededed => ErrorReason == null; | ||
|
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. |
||
| } | ||
|
|
||
| /// <summary> | ||
| /// Used to specify the reason why feedback capture failed, in the event of a failure | ||
| /// </summary> | ||
| public enum CaptureFeedbackErrorReason | ||
| { | ||
| /// <summary> | ||
| /// <para> | ||
| /// An unknown error occurred (enable debug mode and check the logs for details). | ||
| /// </para> | ||
| /// <para> | ||
| /// Possible causes: | ||
| /// <list type="bullet"> | ||
| /// <item> | ||
| /// <description>An exception from the configureScope callback</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <description>A transmission error when sending the envelope</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <description>An attempt to send feedback while the application is shutting down</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <description>Something more mysterious...</description> | ||
| /// </item> | ||
| /// </list> | ||
| /// </para> | ||
| /// </summary> | ||
| UnknownError, | ||
| /// <summary> | ||
| /// Sentry is disabled (very likely an empty DSN was provided when initialising the SDK). | ||
| /// </summary> | ||
| DisabledHub, | ||
| /// <summary> | ||
| /// The <see cref="SentryFeedback.Message"/> message is empty. | ||
| /// </summary> | ||
| EmptyMessage, | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.