Skip to content
Snippets Groups Projects
Commit 63f53a96 authored by Petar Hristov's avatar Petar Hristov :speech_balloon:
Browse files

Update: Add Logs and Docs (coscine/issues#1711)

parent 9e9cf296
No related branches found
No related tags found
1 merge request!45Hotfix/64 release ude
## C# Template
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.
![alt text](docs/images/create_project.png "Create a new Project")
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)
# Blob API
This API handles the connection to the data stored in Coscine.
......@@ -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");
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment