diff options
author | vnugent <public@vaughnnugent.com> | 2024-03-10 15:50:07 -0400 |
---|---|---|
committer | vnugent <public@vaughnnugent.com> | 2024-03-10 15:50:07 -0400 |
commit | 323ff67badfc46ad638d75f059d60d9425ccb2fa (patch) | |
tree | 6f4d824eaea0f4c433f98c0685bf66c06b30e16a /lib/VNLib.Data.Caching.Extensions/src/ApiModel | |
parent | 5d4192880654fd6e00e587814169415b42621327 (diff) |
ci(server): Conainerize and add vncache server packages
Diffstat (limited to 'lib/VNLib.Data.Caching.Extensions/src/ApiModel')
-rw-r--r-- | lib/VNLib.Data.Caching.Extensions/src/ApiModel/CacheSiteAdapter.cs | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/VNLib.Data.Caching.Extensions/src/ApiModel/CacheSiteAdapter.cs b/lib/VNLib.Data.Caching.Extensions/src/ApiModel/CacheSiteAdapter.cs index b6add7d..6edb912 100644 --- a/lib/VNLib.Data.Caching.Extensions/src/ApiModel/CacheSiteAdapter.cs +++ b/lib/VNLib.Data.Caching.Extensions/src/ApiModel/CacheSiteAdapter.cs @@ -24,6 +24,7 @@ using System; using System.Net; +using System.Security; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -72,7 +73,23 @@ namespace VNLib.Data.Caching.Extensions.ApiModel } public override void OnResponse(RestResponse response) - { } + { + switch(response.StatusCode) + { + case HttpStatusCode.OK: + break; + case HttpStatusCode.Unauthorized: + throw new SecurityException("Unauthorized access to cache service"); + case HttpStatusCode.Forbidden: + throw new SecurityException("Forbidden access to cache service"); + case HttpStatusCode.NotFound: + throw new InvalidOperationException("Cache service not found"); + case HttpStatusCode.InternalServerError: + throw new InvalidOperationException("Cache service internal error"); + default: + throw new InvalidOperationException($"Cache service error: {response.StatusCode}"); + } + } public override Task WaitAsync(CancellationToken cancellation = default) { |