Skip to content

Commit 7429ce0

Browse files
author
Kevin Hellemun
committed
Changed some method signatures for cleaner code. (#63)
1 parent 3698815 commit 7429ce0

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

BunqSdk/Exception/ExceptionFactory.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ public static ApiException CreateExceptionForResponse(
2525
int responseCode,
2626
IList<string> messages,
2727
string responseId
28-
)
28+
)
2929
{
30-
var errorMessage = ConcatenateAllMessage(messages, responseId);
30+
var errorMessage = FormatExceptionMessage(messages, responseId);
3131

3232
switch (responseCode)
3333
{
@@ -50,7 +50,10 @@ string responseId
5050
}
5151
}
5252

53-
private static string ConcatenateAllMessage(IEnumerable<string> messages, string responseId)
53+
/// <summary>
54+
/// Formats the exception message accordingly.
55+
/// </summary>
56+
private static string FormatExceptionMessage(IEnumerable<string> messages, string responseId)
5457
{
5558
return string.Format(FORMAT_ERROR_MESSAGE,
5659
responseId,

BunqSdk/Http/ApiClient.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,11 +293,11 @@ private static void AssertResponseSuccess(HttpResponseMessage responseMessage)
293293
throw CreateApiExceptionRequestUnsuccessful(
294294
responseCode,
295295
responseBody,
296-
GetResponseId(responseMessage.Headers)
297-
);
296+
DetermineResponseIdByAllHeader(responseMessage.Headers)
297+
);
298298
}
299299

300-
private static string GetResponseId(HttpHeaders allHeader)
300+
private static string DetermineResponseIdByAllHeader(HttpHeaders allHeader)
301301
{
302302
if (allHeader.Contains(HEADER_RESPONSE_ID_UPPER_CASE))
303303
{

0 commit comments

Comments
 (0)