mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-26 14:37:44 +01:00
Trace log these exceptions
This commit is contained in:
@@ -219,8 +219,13 @@ namespace Tgstation.Server.Host.Controllers
|
||||
/// <summary>
|
||||
/// Generic 501 response.
|
||||
/// </summary>
|
||||
/// <param name="ex">The <see cref="NotImplementedException"/> that was thrown.</param>
|
||||
/// <returns>An <see cref="ObjectResult"/> with <see cref="HttpStatusCode.NotImplemented"/>.</returns>
|
||||
protected ObjectResult RequiresPosixSystemIdentity() => StatusCode(HttpStatusCode.NotImplemented, new ErrorMessageResponse(ErrorCode.RequiresPosixSystemIdentity));
|
||||
protected ObjectResult RequiresPosixSystemIdentity(NotImplementedException ex)
|
||||
{
|
||||
Logger.LogTrace(ex, "System identities not implemented!");
|
||||
return StatusCode(HttpStatusCode.NotImplemented, new ErrorMessageResponse(ErrorCode.RequiresPosixSystemIdentity));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Strongly type calls to <see cref="ControllerBase.StatusCode(int)"/>.
|
||||
|
||||
@@ -97,9 +97,9 @@ namespace Tgstation.Server.Host.Controllers
|
||||
AdditionalData = e.Message,
|
||||
});
|
||||
}
|
||||
catch (NotImplementedException)
|
||||
catch (NotImplementedException ex)
|
||||
{
|
||||
return RequiresPosixSystemIdentity();
|
||||
return RequiresPosixSystemIdentity(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,9 +142,9 @@ namespace Tgstation.Server.Host.Controllers
|
||||
AdditionalData = e.Message,
|
||||
});
|
||||
}
|
||||
catch (NotImplementedException)
|
||||
catch (NotImplementedException ex)
|
||||
{
|
||||
return RequiresPosixSystemIdentity();
|
||||
return RequiresPosixSystemIdentity(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,10 +188,10 @@ namespace Tgstation.Server.Host.Controllers
|
||||
.AsQueryable()
|
||||
.OrderBy(x => x.Path));
|
||||
}
|
||||
catch (NotImplementedException)
|
||||
catch (NotImplementedException ex)
|
||||
{
|
||||
return new PaginatableResult<ConfigurationFileResponse>(
|
||||
RequiresPosixSystemIdentity());
|
||||
RequiresPosixSystemIdentity(ex));
|
||||
}
|
||||
catch (UnauthorizedAccessException)
|
||||
{
|
||||
@@ -262,9 +262,9 @@ namespace Tgstation.Server.Host.Controllers
|
||||
Message = e.Message,
|
||||
});
|
||||
}
|
||||
catch (NotImplementedException)
|
||||
catch (NotImplementedException ex)
|
||||
{
|
||||
return RequiresPosixSystemIdentity();
|
||||
return RequiresPosixSystemIdentity(ex);
|
||||
}
|
||||
catch (UnauthorizedAccessException)
|
||||
{
|
||||
@@ -302,9 +302,9 @@ namespace Tgstation.Server.Host.Controllers
|
||||
? NoContent()
|
||||
: Conflict(new ErrorMessageResponse(ErrorCode.ConfigurationDirectoryNotEmpty)));
|
||||
}
|
||||
catch (NotImplementedException)
|
||||
catch (NotImplementedException ex)
|
||||
{
|
||||
return RequiresPosixSystemIdentity();
|
||||
return RequiresPosixSystemIdentity(ex);
|
||||
}
|
||||
catch (UnauthorizedAccessException)
|
||||
{
|
||||
|
||||
@@ -241,7 +241,7 @@ namespace Tgstation.Server.Host.Controllers
|
||||
}
|
||||
catch (NotImplementedException ex)
|
||||
{
|
||||
Logger.LogTrace(ex, "System identities not implemented!");
|
||||
RequiresPosixSystemIdentity(ex);
|
||||
}
|
||||
|
||||
using (systemIdentity)
|
||||
|
||||
@@ -127,9 +127,9 @@ namespace Tgstation.Server.Host.Controllers
|
||||
dbUser.Name = sysIdentity.Username;
|
||||
dbUser.SystemIdentifier = sysIdentity.Uid;
|
||||
}
|
||||
catch (NotImplementedException)
|
||||
catch (NotImplementedException ex)
|
||||
{
|
||||
return RequiresPosixSystemIdentity();
|
||||
return RequiresPosixSystemIdentity(ex);
|
||||
}
|
||||
else if (!(model.Password?.Length == 0 && model.OAuthConnections?.Any() == true))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user