mirror of
https://github.com/yawaflua/yaflay.ru.git
synced 2026-02-04 19:04:12 +02:00
setting up logging in controller
This commit is contained in:
@@ -74,6 +74,8 @@ namespace yaflay.ru.Новая_папка
|
|||||||
string responseBody = await message.Content.ReadAsStringAsync();
|
string responseBody = await message.Content.ReadAsStringAsync();
|
||||||
JsonNode response = JsonNode.Parse(responseBody);
|
JsonNode response = JsonNode.Parse(responseBody);
|
||||||
if (response["user"] != null || response["user"]?["id"].ToString() == Startup.ownerId)
|
if (response["user"] != null || response["user"]?["id"].ToString() == Startup.ownerId)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
Author author = new()
|
Author author = new()
|
||||||
{
|
{
|
||||||
@@ -93,6 +95,15 @@ namespace yaflay.ru.Новая_папка
|
|||||||
await Startup.dbContext.SaveChangesAsync();
|
await Startup.dbContext.SaveChangesAsync();
|
||||||
return Ok(body);
|
return Ok(body);
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine("error: HomeController error");
|
||||||
|
Console.WriteLine("debug: lines: 80-96");
|
||||||
|
Console.WriteLine($"debug: data from site: {body}");
|
||||||
|
Console.WriteLine($"debug: exception: {ex.Message}");
|
||||||
|
return StatusCode(500, body);
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return Unauthorized(body);
|
return Unauthorized(body);
|
||||||
|
|||||||
Reference in New Issue
Block a user