Skip to content

Commit

Permalink
chore: Remove IBugsnagger::*Async
Browse files Browse the repository at this point in the history
Not a whole mountain of need to expose a Task for the app to
await on, honestly, maybe an OnError callback to know if things _are_
going wrong, but shouldn't need any more than that.
  • Loading branch information
awseward committed Mar 21, 2018
1 parent 82f0156 commit 95c05de
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 102 deletions.
49 changes: 0 additions & 49 deletions Bugsnag.NET/Bugsnagger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,83 +21,34 @@ public class Bugsnagger : IBugsnagger
public Func<IMutableStackTraceLine, IStackTraceLine> FinalizeStacktraceLine { get; set; } = x => x;
public Func<IMutableEvent, Exception, IEvent> FinalizeEvent { get; set; } = (@event, ex) => @event;

[Obsolete("Has not been verified to work yet")]
public Task<HttpResponseMessage> ErrorAsync(Exception ex, IUser user, object metadata)
{
var @event = this.CreateEvent(Severity.Error, ex, user, metadata);

return NotifyAsync(@event);
}

[Obsolete("Has not been verified to work yet")]
public Task<HttpResponseMessage> WarningAsync(Exception ex, IUser user, object metadata)
{
var @event = this.CreateEvent(Severity.Warning, ex, user, metadata);

return NotifyAsync(@event);
}

[Obsolete("Has not been verified to work yet")]
public Task<HttpResponseMessage> InfoAsync(Exception ex, IUser user, object metadata)
{
var @event = this.CreateEvent(Severity.Info, ex, user, metadata);

return NotifyAsync(@event);
}

[Obsolete("Has not been verified to work yet")]
public Task<HttpResponseMessage> NotifyAsync(IEvent @event) => NotifyAsync(@event, true);

[Obsolete("Has not been verified to work yet")]
public Task<HttpResponseMessage> NotifyAsync(IEvent @event, bool useSSL) =>
NotifyAsync(new[] { @event }, useSSL);

[Obsolete("Has not been verified to work yet")]
public Task<HttpResponseMessage> NotifyAsync(IEnumerable<IEvent> events) => NotifyAsync(events, true);

[Obsolete("Has not been verified to work yet")]
public Task<HttpResponseMessage> NotifyAsync(IEnumerable<IEvent> events, bool useSSL)
{
var notice = new Notice(ApiKey, Notifier, events);

return _Client.SendAsync(notice, useSSL);
}

[Obsolete("Prefer ErrorAsync")]
public void Error(Exception ex, IUser user, object metadata)
{
var @event = this.CreateEvent(Severity.Error, ex, user, metadata);

Notify(@event);
}

[Obsolete("Prefer WarningAsync")]
public void Warning(Exception ex, IUser user, object metadata)
{
var @event = this.CreateEvent(Severity.Warning, ex, user, metadata);

Notify(@event);
}

[Obsolete("Prefer InfoAsync")]
public void Info(Exception ex, IUser user, object metadata)
{
var @event = this.CreateEvent(Severity.Info, ex, user, metadata);

Notify(@event);
}

[Obsolete("Prefer NotifyAsync")]
public void Notify(IEvent @event) => Notify(@event, true);

[Obsolete("Prefer NotifyAsync")]
public void Notify(IEvent @event, bool useHttps) =>
Notify(new[] { @event }, useHttps);

[Obsolete("Prefer NotifyAsync")]
public void Notify(IEnumerable<IEvent> events) => Notify(events, true);

[Obsolete("Prefer NotifyAsync")]
public void Notify(IEnumerable<IEvent> events, bool useHttps)
{
var notice = new Notice(ApiKey, Notifier, events);
Expand Down
44 changes: 0 additions & 44 deletions Bugsnag.PCL/Bugsnagger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,77 +21,33 @@ public class Bugsnagger : IBugsnagger
public Func<IMutableStackTraceLine, IStackTraceLine> FinalizeStacktraceLine { get; set; } = x => x;
public Func<IMutableEvent, Exception, IEvent> FinalizeEvent { get; set; } = (@event, ex) => @event;

public Task<HttpResponseMessage> ErrorAsync(Exception ex, IUser user, object metadata)
{
var @event = this.CreateEvent(Severity.Error, ex, user, metadata);

return NotifyAsync(@event);
}

public Task<HttpResponseMessage> WarningAsync(Exception ex, IUser user, object metadata)
{
var @event = this.CreateEvent(Severity.Warning, ex, user, metadata);

return NotifyAsync(@event);
}

public Task<HttpResponseMessage> InfoAsync(Exception ex, IUser user, object metadata)
{
var @event = this.CreateEvent(Severity.Info, ex, user, metadata);

return NotifyAsync(@event);
}

public Task<HttpResponseMessage> NotifyAsync(IEvent @event) =>
NotifyAsync(@event, true);

public Task<HttpResponseMessage> NotifyAsync(IEvent @event, bool useSSL) =>
NotifyAsync(new[] { @event }, useSSL);

public Task<HttpResponseMessage> NotifyAsync(IEnumerable<IEvent> events) =>
NotifyAsync(events, true);

public Task<HttpResponseMessage> NotifyAsync(IEnumerable<IEvent> events, bool useSSL)
{
var notice = new Notice(ApiKey, Notifier, events);

return _Client.SendAsync(notice, useSSL);
}

[Obsolete("Prefer ErrorAsync")]
public void Error(Exception ex, IUser user, object metadata)
{
var @event = this.CreateEvent(Severity.Error, ex, user, metadata);

Notify(@event);
}

[Obsolete("Prefer WarningAsync")]
public void Warning(Exception ex, IUser user, object metadata)
{
var @event = this.CreateEvent(Severity.Warning, ex, user, metadata);

Notify(@event);
}

[Obsolete("Prefer InfoAsync")]
public void Info(Exception ex, IUser user, object metadata)
{
var @event = this.CreateEvent(Severity.Info, ex, user, metadata);

Notify(@event);
}

[Obsolete("Prefer NotifyAsync")]
public void Notify(IEvent @event) => Notify(@event, true);

[Obsolete("Prefer NotifyAsync")]
public void Notify(IEvent @event, bool useHttps) => Notify(new[] { @event }, useHttps);

[Obsolete("Prefer NotifyAsync")]
public void Notify(IEnumerable<IEvent> events) => Notify(events, true);

[Obsolete("Prefer NotifyAsync")]
public void Notify(IEnumerable<IEvent> events, bool useSSL)
{
var notice = new Notice(ApiKey, Notifier, events);
Expand Down
9 changes: 0 additions & 9 deletions lib/Bugsnag.Common/Interfaces/IBugsnagger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,9 @@ public interface IBugsnagger
void Warning(Exception ex, IUser user, object metadata);
void Info(Exception ex, IUser user, object metadata);

Task<HttpResponseMessage> ErrorAsync(Exception ex, IUser user, object metadata);
Task<HttpResponseMessage> WarningAsync(Exception ex, IUser user, object metadata);
Task<HttpResponseMessage> InfoAsync(Exception ex, IUser user, object metadata);

void Notify(IEvent @event);
void Notify(IEvent @event, bool useHttps);
void Notify(IEnumerable<IEvent> events);
void Notify(IEnumerable<IEvent> events, bool useHttps);

Task<HttpResponseMessage> NotifyAsync(IEvent @event);
Task<HttpResponseMessage> NotifyAsync(IEvent @event, bool useSSL);
Task<HttpResponseMessage> NotifyAsync(IEnumerable<IEvent> events);
Task<HttpResponseMessage> NotifyAsync(IEnumerable<IEvent> events, bool useSSL);
}
}

0 comments on commit 95c05de

Please sign in to comment.