Skip to content

Commit

Permalink
Error messages included in SlackException message
Browse files Browse the repository at this point in the history
  • Loading branch information
soxtoby committed Mar 17, 2024
1 parent 35b2528 commit 1856c18
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion SlackNet/SlackException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ public class SlackException : Exception
public SlackException(ErrorResponse errorResponse)
: base(errorResponse == null
? "Slack returned an unknown error response type"
: $"Slack returned an error response: {errorResponse.Error}.")
: string.Join(Environment.NewLine,
new[] { $"Slack returned an error response: {errorResponse.Error}." }
.Concat(errorResponse.ResponseMetadata?.Messages ?? [])))
{
ErrorCode = errorResponse?.Error ?? "unknown";
ErrorMessages = errorResponse?.ResponseMetadata?.Messages.ToList() ?? [];
Expand Down
2 changes: 1 addition & 1 deletion SlackNet/WebApi/CallsApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public interface ICallsApi
/// <remarks>See the <a href="https://api.slack.com/methods/calls.add">Slack documentation</a> for more information.</remarks>
/// <param name="externalUniqueId">An ID supplied by the 3rd-party Call provider. It must be unique across all Calls from that service.</param>
/// <param name="joinUrl">The URL required for a client to join the Call.</param>
/// <param name="createdByUserId">The valid Slack user ID of the user who created this Call. When this method is called with a user token, the <see cref="createdBy"/> parameter is optional and defaults to the authed user of the token. Otherwise, the field is required.</param>
/// <param name="createdByUserId">The valid Slack user ID of the user who created this Call. When this method is called with a user token, the <see cref="createdByUserId"/> parameter is optional and defaults to the authed user of the token. Otherwise, the field is required.</param>
/// <param name="dateStart">Call start time.</param>
/// <param name="desktopAppJoinUrl">When supplied, available Slack clients will attempt to directly launch the 3rd-party Call with this URL.</param>
/// <param name="externalDisplayId">An optional, human-readable ID supplied by the 3rd-party Call provider. If supplied, this ID will be displayed in the Call object.</param>
Expand Down

0 comments on commit 1856c18

Please sign in to comment.