Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Feature public sentryevent.tags #159

Merged
merged 1 commit into from
Sep 19, 2016

Conversation

samukce
Copy link
Contributor

@samukce samukce commented Sep 19, 2016

Complementing the PR #149. Some tests case to ensure public assign from SentryEvent.Tags


This change is Reviewable

@samukce
Copy link
Contributor Author

samukce commented Sep 19, 2016

@asbjornu done. o/

samukce referenced this pull request Sep 19, 2016
To make it easier to include tags directly when constructing a new
`SentryEvent`.

Related to PR #149.
@asbjornu
Copy link
Contributor

@samukce Excellent! But can you perhaps remove the three merge commits from this PR? This is rather easy to do by resetting this branch to the latest develop and then doing cherry-pick to pick the interesting commit from here. Like so:

git fetch getsentry
git checkout feature/publicTagsSentryEvent
git reset --hard getsentry/develop
git cherry-pick 8d868bf5417ee8f5824faf1102d05306f4708278
git push --force

@samukce samukce force-pushed the feature/publicTagsSentryEvent branch from 8d868bf to 06f59a4 Compare September 19, 2016 11:21
@samukce
Copy link
Contributor Author

samukce commented Sep 19, 2016

@asbjornu thanks for the feedback. Done.

@samukce samukce closed this Sep 19, 2016
@samukce samukce reopened this Sep 19, 2016
Copy link
Contributor

@asbjornu asbjornu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I have one small question, otherwise this looks good. 👍

var sentryEvent = new SentryEvent(new Exception("foo"));
var beforeDictionary = sentryEvent.Tags;

Assert.That(beforeDictionary, Is.SameAs(sentryEvent.Tags));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite see the value of this assertion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The get/set execute some procedures how instance new dictionary. Some refactor could inject a bug, for instance, a new dictionary, what could losing data.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point!

@asbjornu asbjornu merged commit a6747e4 into getsentry:develop Sep 19, 2016
{
var sentryEvent = new SentryEvent(new Exception("foo")) { Tags = null};

Assert.That(sentryEvent.Tags, Is.Not.Null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding this. The test case is great, but the "feature" feels a bit weird. I would really prefer if the setter of Tags threw an ArgumentNullException or similar when trying to set it to null. Setting something to null and then making sure it wasn't set to null doesn't really make sense?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@genne: Good point. Let's do ArgumentNullException, then. PR incoming? 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this api should work similar to the log4net, i mean when any is wrong with the API, this not interfere of the function of the software.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samukce While I understand that design principle from a logging framework, there's already quite a few throw statements in there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asbjornu but do you agree that some simple exceptions could be avoided?

Copy link
Contributor

@asbjornu asbjornu Sep 20, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but in this case, I'm basically ¯\_(ツ)_/¯.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants