Skip to content

Commit e916792

Browse files
author
Ivo Salmre
committed
Small improvements to better log authorization errors
1 parent 9e8386f commit e916792

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11

22
*.user
3+
/.vs

CloudbedsDataManagers/CloudbedsReservationWithRoomsManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ private void helper_queryAndAppendReservations(Dictionary<string, CloudbedsReser
338338

339339
if (!querySuccessProximateCheckIn)
340340
{
341-
throw new Exception("240320-848: CloudbedsReservationWithRoomsManager, query failure for filter: " + reservationStatus);
341+
throw new Exception("240415-831: CloudbedsReservationWithRoomsManager, query failure for filter: " + reservationStatus);
342342
}
343343

344344
helper_appendUniqueItemsToDictionary(buildSet, cbQueryProximateCheckIn.CommandResults_Reservations);

RESTHelpers_Cloudbeds/CloudbedsRequestReservationsWithRoomRatesBase.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,11 @@ public List<CloudbedsReservationWithRooms> ExecuteRequest_SinglePage(int pageNum
165165
//https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-use-dom-utf8jsonreader-utf8jsonwriter?pivots=dotnet-6-0
166166
using (response)
167167
{
168+
if(response.StatusCode == HttpStatusCode.Unauthorized)
169+
{
170+
throw new Exception("0415-833: Server request returned 'unauthorized' for " + url);
171+
}
172+
168173
var jsonOut = GetWebResponseAsJson(response, false);
169174
_commandResultJson = jsonOut;
170175

0 commit comments

Comments
 (0)