diff --git a/README.md b/README.md index 07fd7a148fb8b41ad9725988b12afb96e3cdf17a..84a2400b90c21b27b40e8bdaf9347046bb3f46bd 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,3 @@ -## C# Template +# Blob API -This template includes: - -* Automatic building using cake -* Automatic testing with NUnit -* Automatic linting with Resharper -* Automatic documentation publishing using Gitlab CI / CD and a self written script which puts the docs in the docs folder to the wiki -* Automatic releases using semantic-release ([ESLint Code Convention](docs/ESLintConvention)), cake and Gitlab CI / CD - -## What you need to do - -Place you C# project solution file in .src/. -Make sure Create directory for solution is unticked. - - - -Delete unused docs and update this README. - -Add [NUnit](docs/nunit.md) tests to your solution. - -## Building - -Build this project by running either the build.ps1 or the build<span></span>.sh script. -The project will be build and tested. - -### Links - -* [Commit convention](docs/ESLintConvention.md) -* [Everything possible with markup](docs/testdoc.md) -* [Adding NUnit tests](docs/nunit.md) - +This API handles the connection to the data stored in Coscine. diff --git a/src/Blob/Controllers/BlobController.cs b/src/Blob/Controllers/BlobController.cs index 55e0989bef8808c5dd9eb87f8b252109addfeb7f..4b44b21a084ee9a926406657abb7afbd7f02c359 100644 --- a/src/Blob/Controllers/BlobController.cs +++ b/src/Blob/Controllers/BlobController.cs @@ -122,8 +122,9 @@ namespace Coscine.Api.Blob.Controllers var totalFileSize = resourceTypeDefinition.GetResourceQuotaUsed(resourceId, resourceTypeOptions).Result; return Ok($"{{ \"data\": {{ \"usedSizeByte\": {totalFileSize} }}}}"); } - catch + catch (Exception e) { + _coscineLogger.Log("Get Quota failed", e); return BadRequest($"Error in communication with the resource"); } } @@ -174,8 +175,9 @@ namespace Coscine.Api.Blob.Controllers LogAnalytics("Download File", resourceId, path.Substring(1), user); return File(response, contentType ?? "application/octet-stream"); } - catch + catch (Exception e) { + _coscineLogger.Log("Get File failed", e); return BadRequest($"Error in communication with the resource"); } } @@ -252,6 +254,7 @@ namespace Coscine.Api.Blob.Controllers } catch (Exception e) { + _coscineLogger.Log("Upload File failed", e); return BadRequest($"Error in communication with the resource"); } } @@ -300,8 +303,9 @@ namespace Coscine.Api.Blob.Controllers LogAnalytics("Delete File", resourceId, path, user); return NoContent(); } - catch + catch (Exception e) { + _coscineLogger.Log("Delete failed", e); return BadRequest($"Error in communication with the resource"); } } @@ -339,8 +343,9 @@ namespace Coscine.Api.Blob.Controllers await resourceTypeDefinition.IsResourceCreated("", resourceTypeOptions); return NoContent(); } - catch + catch (Exception e) { + _coscineLogger.Log("Resource validation failed", e); return BadRequest($"Error in communication with the resource"); } }