mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2025-12-21 16:58:37 +00:00
Initial code cleanup
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
// limitations under the License.
|
||||
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Net;
|
||||
using ArchiSteamFarm.IPC.Responses;
|
||||
using ArchiSteamFarm.Localization;
|
||||
@@ -45,7 +46,7 @@ namespace ArchiSteamFarm.IPC.Controllers.Api {
|
||||
Type? targetType = WebUtilities.ParseType(structure);
|
||||
|
||||
if (targetType == null) {
|
||||
return BadRequest(new GenericResponse(false, string.Format(Strings.ErrorIsInvalid, structure)));
|
||||
return BadRequest(new GenericResponse(false, string.Format(CultureInfo.CurrentCulture, Strings.ErrorIsInvalid, structure)));
|
||||
}
|
||||
|
||||
object? obj;
|
||||
@@ -53,7 +54,7 @@ namespace ArchiSteamFarm.IPC.Controllers.Api {
|
||||
try {
|
||||
obj = Activator.CreateInstance(targetType, true);
|
||||
} catch (Exception e) {
|
||||
return BadRequest(new GenericResponse(false, string.Format(Strings.ErrorParsingObject, nameof(targetType)) + Environment.NewLine + e));
|
||||
return BadRequest(new GenericResponse(false, string.Format(CultureInfo.CurrentCulture, Strings.ErrorParsingObject, nameof(targetType)) + Environment.NewLine + e));
|
||||
}
|
||||
|
||||
return Ok(new GenericResponse<object>(obj));
|
||||
|
||||
Reference in New Issue
Block a user