diff --git a/LICENSE b/LICENSE deleted file mode 100644 index a04e554..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 Marcel Lorbeer - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/README.md b/README.md index c17e94b..411c66c 100644 Binary files a/README.md and b/README.md differ diff --git a/src/MarcSync/Errors/Authorization.lua b/src/MarcSync/Errors/Authorization.lua new file mode 100644 index 0000000..cfb685d --- /dev/null +++ b/src/MarcSync/Errors/Authorization.lua @@ -0,0 +1,5 @@ +return { + InvalidAccessToken = function(message: string):string + return ("[MarcSync Exception] InvalidAccessToken: %s"):format(message) + end +} \ No newline at end of file diff --git a/src/MarcSync/Errors/Autorisierung.lua b/src/MarcSync/Errors/Autorisierung.lua deleted file mode 100644 index 2535fd3..0000000 --- a/src/MarcSync/Errors/Autorisierung.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - InvalidAccessToken = function(message: string):string - return ("[MarkSynchronisationsausnahme] InvaliederZugriffsToken: %s"):format(message) - end -} diff --git a/src/MarcSync/Errors/Collection.lua b/src/MarcSync/Errors/Collection.lua new file mode 100644 index 0000000..c59ddde --- /dev/null +++ b/src/MarcSync/Errors/Collection.lua @@ -0,0 +1,8 @@ +return { + CollectionNotFound = function(message: string):string + return ("[MarcSync Exception] CollectionNotFound: %s"):format(message) + end, + CollectionAlreadyExists = function(message: string):string + return ("[MarcSync Exception] CollectionAlreadyExists: %s"):format(message) + end +} \ No newline at end of file diff --git a/src/MarcSync/Errors/Eintrag.lua b/src/MarcSync/Errors/Eintrag.lua deleted file mode 100644 index 2098947..0000000 --- a/src/MarcSync/Errors/Eintrag.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - InvalidEntryData = function(message: string):string - return ("[MarkSynchronisationsausnahme] InvaliedeEintragsDaten: %s"):format(message) - end, - EntryNotFound = function(message: string):string - return ("[MarkSynchronisationsausnahme] EintragNichtGefunden: %s"):format(message) - end -} diff --git a/src/MarcSync/Errors/Entry.lua b/src/MarcSync/Errors/Entry.lua new file mode 100644 index 0000000..5d51edb --- /dev/null +++ b/src/MarcSync/Errors/Entry.lua @@ -0,0 +1,8 @@ +return { + InvalidEntryData = function(message: string):string + return ("[MarcSync Exception] InvalidEntryData: %s"):format(message) + end, + EntryNotFound = function(message: string):string + return ("[MarcSync Exception] EntryNotFound: %s"):format(message) + end +} \ No newline at end of file diff --git a/src/MarcSync/Errors/Sammlung.lua b/src/MarcSync/Errors/Sammlung.lua deleted file mode 100644 index 0690dd3..0000000 --- a/src/MarcSync/Errors/Sammlung.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - CollectionNotFound = function(message: string):string - return ("[MarkSynchronisationsausnahme] SammlungNichtGefunden: %s"):format(message) - end, - CollectionAlreadyExists = function(message: string):string - return ("[MarkSynchronisationsausnahme] SammlungExistiertBereits: %s"):format(message) - end -} diff --git a/src/MarcSync/MarcSyncv1.0.lua b/src/MarcSync/MarcSyncv1.0.lua index c8dab92..ef8a2b5 100644 --- a/src/MarcSync/MarcSyncv1.0.lua +++ b/src/MarcSync/MarcSyncv1.0.lua @@ -5,53 +5,53 @@ local tokens = { -- DO NOT EDIT THE FOLLOWING LINES BELOW, UNLESS YOU KNOW WHAT YOU ARE DOING! -local Utils = require(script.Parent.Dienstprogramme) +local Utils = require(script.Parent.Utils) local MarcSyncClient = {} -MarcSyncClient.bekommeVersion = function(self:typeof(MarcSyncClient), clientId: number?):string +MarcSyncClient.getVersion = function(self:typeof(MarcSyncClient), clientId: number?):string self:_checkInstallation() local url = "" if clientId then url = "/"..clientId end - local result = Utils.macheHypertexttransferprotokollAnfrage("GET", "https://api.marcsync.dev/v0/utils/version"..url); + local result = Utils.makeHTTPRequest("GET", "https://api.marcsync.dev/v0/utils/version"..url); return result["version"] end -MarcSyncClient.erzeugeSammlung = function(self:typeof(MarcSyncClient), collectionName: string):typeof(require(script.Parent.Objects.Sammlung).new()) - if not self._accessToken then error("[MarkSynchronisation] Bitte legen Sie ein Token fest, bevor Sie MarcSync verwenden.") end - if not collectionName then error("Kein CollectionName angegeben") end - local result = Utils.macheHypertexttransferprotokollAnfrage("collection", "POST", "https://api.marcsync.dev/v0/collection/"..collectionName, {}, self._accessToken); +MarcSyncClient.createCollection = function(self:typeof(MarcSyncClient), collectionName: string):typeof(require(script.Parent.Objects.Collection).new()) + if not self._accessToken then error("[MarcSync] Please set a Token before using MarcSync.") end + if not collectionName then error("No CollectionName Provided") end + local result = Utils.makeHTTPRequest("collection", "POST", "https://api.marcsync.dev/v0/collection/"..collectionName, {}, self._accessToken); if not result["success"] then error(result["errorMessage"]) end - result = require(script.Parent.Objects.Sammlung).neu(collectionName, self._accessToken) + result = require(script.Parent.Objects.Collection).new(collectionName, self._accessToken) return result end -MarcSyncClient.bringeSammlung = function(self:typeof(MarcSyncClient), collectionName: string):typeof(require(script.Parent.Objects.Sammlung).new()) +MarcSyncClient.fetchCollection = function(self:typeof(MarcSyncClient), collectionName: string):typeof(require(script.Parent.Objects.Collection).new()) self:_checkInstallation() - if not collectionName then error("Kein CollectionName angegeben") end - local result = Utils.macheHypertexttransferprotokollAnfrage("collection", "GET", "https://api.marcsync.dev/v0/collection/"..collectionName, {}, self._accessToken); + if not collectionName then error("No CollectionName Provided") end + local result = Utils.makeHTTPRequest("collection", "GET", "https://api.marcsync.dev/v0/collection/"..collectionName, {}, self._accessToken); if not result["success"] then error(result["errorMessage"]) end - result = require(script.Parent.Objects.Sammlung).neu(collectionName, self._accessToken) + result = require(script.Parent.Objects.Collection).new(collectionName, self._accessToken) return result end -MarcSyncClient.bekommeSammlung = function(self:typeof(MarcSyncClient), collectionName: string):typeof(require(script.Parent.Objects.Sammlung).new()) - if typeof(self) ~= "table" then error("Bitte verwenden Sie : anstelle von .") end +MarcSyncClient.getCollection = function(self:typeof(MarcSyncClient), collectionName: string):typeof(require(script.Parent.Objects.Collection).new()) + if typeof(self) ~= "table" then error("Please use : instead of .") end self:_checkInstallation() - if not collectionName then error("Kein CollectionName angegeben") end - return require(script.Parent.Objects.Sammlung).neu(collectionName, self._accessToken) + if not collectionName then error("No CollectionName Provided") end + return require(script.Parent.Objects.Collection).new(collectionName, self._accessToken) end return { - neu = function(accessToken: string):typeof(MarcSyncClient) - if not accessToken then warn("Beim Erstellen eines neuen MarcSync-Objekts wurde kein Token bereitgestellt.") end - if not tokens[accessToken] then warn("Token zum Erstellen eines neuen MarcSync-Objekts, das nicht in der Token-Tabelle gefunden wird und stattdessen als Token verwendet wird.") else accessToken = tokens[accessToken] end + new = function(accessToken: string):typeof(MarcSyncClient) + if not accessToken then warn("Token not provided while creating a new MarcSync Object.") end + if not tokens[accessToken] then warn("Token provided for creating a new MarcSync Object not Found in Token Table, using it as token instead.") else accessToken = tokens[accessToken] end local self = {} self._accessToken = accessToken self._checkInstallation = function() - if not self then error("Bitte richten Sie MarcSync ein, bevor Sie MarcSync verwenden.") end - if not self._accessToken then error("[MarkSynchronisation] Bitte legen Sie ein Token fest, bevor Sie MarcSync verwenden.") end + if not self then error("Please Setup MarcSync before using MarcSync.") end + if not self._accessToken then error("[MarcSync] Please set a Token before using MarcSync.") end --print(HttpService.HttpEnabled) --if not HttpService.HttpEnabled then error("Please Enable HTTPService in order to use MarcSync.") end end @@ -62,4 +62,4 @@ return { return self end -} +} \ No newline at end of file diff --git a/src/MarcSync/Objects/Collection.lua b/src/MarcSync/Objects/Collection.lua new file mode 100644 index 0000000..73c0d79 --- /dev/null +++ b/src/MarcSync/Objects/Collection.lua @@ -0,0 +1,76 @@ +local Utils = require(script.Parent.Parent.Utils) +local Entry = require(script.Parent.Entry) + +local types = { + EntryData = require(script.Parent.Parent.Types.EntryData).getType() +} + +local Collection = {} + +Collection.createEntry = function(self:typeof(Collection), data:typeof(types.EntryData)):typeof(Entry.new()) + if not self._collectionName then error("[MarcSync: Collection] Invalid Object created or trying to access an destroied object.") end + local result = Utils.makeHTTPRequest("entry", "POST", "https://api.marcsync.dev/v0/entries/"..self._collectionName, {["data"]=data}, self._accessToken); + + if result["success"] and result["objectId"] then + data["_id"] = result["objectId"] + result = require(script.Parent.Entry).new(self._collectionName, data, self._accessToken) + else + error(result["errorMessage"]) + end + + return result +end + +Collection.updateEntries = function(self:typeof(Collection), filters:typeof(types.EntryData), data:typeof(types.EntryData)):number + if not self._collectionName then error("[MarcSync: Collection] Invalid Object created or trying to access an destroied object.") end + local result = Utils.makeHTTPRequest("entry", "PUT", "https://api.marcsync.dev/v0/entries/"..self._collectionName, {["filters"]=filters,["data"]=data}, self._accessToken); + if not result["success"] then error(result["errorMessage"]) end + + return result["modifiedEntries"] +end + +Collection.getEntries = function(self:typeof(Collection), filters:typeof(types.EntryData)):{[number]:typeof(Entry.new())} + if not self._collectionName then error("[MarcSync: Collection] Invalid Object created or trying to access an destroied object.") end + if not filters then filters = {} end + local result = Utils.makeHTTPRequest("entry", "DELETE", "https://api.marcsync.dev/v0/entries/"..self._collectionName.."?isQuery=true", {["filters"]=filters}, self._accessToken); + if result["success"] and result["entries"] then + local _result = {} + for index,entry in pairs(result["entries"]) do + _result[index] = require(script.Parent.Entry).new(self._collectionName, entry, self._accessToken) + end + result = _result + else + error(result["errorMessage"]) + end + + return result +end + +Collection.deleteEntries = function(self:typeof(Collection), filters:typeof(types.EntryData)):number + if not self._collectionName then error("[MarcSync: Collection] Invalid Object created or trying to access an destroied object.") end + local result = Utils.makeHTTPRequest("DELETE", "https://api.marcsync.dev/v0/entries/"..self._collectionName, {["filters"]=filters}, self._accessToken); + if not result["success"] then error(result["errorMessage"]) end + + return result["deletedEntries"] +end + +Collection.drop = function(self:typeof(Collection)) + if not self._collectionName then error("[MarcSync: Collection] Invalid Object created or trying to access an destroied object.") end + local result = Utils.makeHTTPRequest("collection", "DELETE", "https://api.marcsync.dev/v0/collection/"..self._collectionName, {}, self._accessToken); + if not result["success"] then error(result["errorMessage"]) end + self = nil +end + +return { + new = function(collectionName: string, accessToken: string):typeof(Collection) + local self = {} + self._collectionName = collectionName + self._accessToken = accessToken + + self = setmetatable(self, { + __index = Collection + }) + + return self + end +} \ No newline at end of file diff --git a/src/MarcSync/Objects/Eintrag.lua b/src/MarcSync/Objects/Eintrag.lua deleted file mode 100644 index e37307d..0000000 --- a/src/MarcSync/Objects/Eintrag.lua +++ /dev/null @@ -1,56 +0,0 @@ -local Utils = require(script.Parent.Parent.Dienstprogramme) - -local types = { - EntryData = require(script.Parent.Parent.Types.EntryData).bekommeRassenindentifikationsspezifizierunginstanztextaufzaehlbar() -} - -local Entry = {} - -Entry.bekommeWert = function(self:typeof(Entry), key:string):any - if not key then return nil end - return self._entryData[key] -end - -Entry.bekommeWerte = function(self:typeof(Entry)):typeof(types.EntryData) - return self._entryData -end - -Entry.aktualisiereWerte = function(self:typeof(Entry), data:typeof(types.EntryData)):number - local result = Utils.macheHypertexttransferprotokollAnfrage("eintrag", "PUT", "https://api.marcsync.dev/v0/entries/"..self._tableId, {["filters"]={["_id"]=self._objectId},["data"]=data}, self._accessToken); - - if result["success"] and result["modifiedEntries"] and result["modifiedEntries"] > 0 then - for i,v in pairs(data) do - self._entryData[i] = v - end - elseif not result["success"] then - error(result["errorMessage"]) - end - - return result["modifiedEntries"] -end - -Entry.loesche = function(self:typeof(Entry)) - if typeof(self) ~= "table" then error("Bitte verwenden Sie : anstelle von .") end - local result = Utils.macheHypertexttransferprotokollAnfrage("eintrag", "DELETE", "https://api.marcsync.dev/v0/entries/"..self._tableId, {["filters"]={["_id"]=self._objectId}}, self._accessToken); - - if not result["success"] then error(result["errorMessage"]) end - self = nil - -end - -return { - neu = function(tableId:string, entryData:typeof(types.EntryData), accessToken:string):typeof(Entry) - if not tableId or not entryData or not entryData["_id"] or not accessToken then error("[MarkSynchronisation: Eintrag] Es wurde versucht, ein ungültiges Eintragsobjekt zu erstellen.") end - local self = {} - self._tableId = tableId - self._entryData = entryData - self._objectId = entryData["_id"] - self._accessToken = accessToken - - self = setmetatable(self, { - __index = Entry - }) - - return self - end -} diff --git a/src/MarcSync/Objects/Entry.lua b/src/MarcSync/Objects/Entry.lua new file mode 100644 index 0000000..d28907e --- /dev/null +++ b/src/MarcSync/Objects/Entry.lua @@ -0,0 +1,56 @@ +local Utils = require(script.Parent.Parent.Utils) + +local types = { + EntryData = require(script.Parent.Parent.Types.EntryData).getType() +} + +local Entry = {} + +Entry.getValue = function(self:typeof(Entry), key:string):any + if not key then return nil end + return self._entryData[key] +end + +Entry.getValues = function(self:typeof(Entry)):typeof(types.EntryData) + return self._entryData +end + +Entry.updateValues = function(self:typeof(Entry), data:typeof(types.EntryData)):number + local result = Utils.makeHTTPRequest("entry", "PUT", "https://api.marcsync.dev/v0/entries/"..self._tableId, {["filters"]={["_id"]=self._objectId},["data"]=data}, self._accessToken); + + if result["success"] and result["modifiedEntries"] and result["modifiedEntries"] > 0 then + for i,v in pairs(data) do + self._entryData[i] = v + end + elseif not result["success"] then + error(result["errorMessage"]) + end + + return result["modifiedEntries"] +end + +Entry.delete = function(self:typeof(Entry)) + if typeof(self) ~= "table" then error("Please use : instead of .") end + local result = Utils.makeHTTPRequest("entry", "DELETE", "https://api.marcsync.dev/v0/entries/"..self._tableId, {["filters"]={["_id"]=self._objectId}}, self._accessToken); + + if not result["success"] then error(result["errorMessage"]) end + self = nil + +end + +return { + new = function(tableId:string, entryData:typeof(types.EntryData), accessToken:string):typeof(Entry) + if not tableId or not entryData or not entryData["_id"] or not accessToken then error("[MarcSync: Entry] Tried creating invalid Entry Object.") end + local self = {} + self._tableId = tableId + self._entryData = entryData + self._objectId = entryData["_id"] + self._accessToken = accessToken + + self = setmetatable(self, { + __index = Entry + }) + + return self + end +} \ No newline at end of file diff --git a/src/MarcSync/Objects/Sammlung.lua b/src/MarcSync/Objects/Sammlung.lua deleted file mode 100644 index 51a515a..0000000 --- a/src/MarcSync/Objects/Sammlung.lua +++ /dev/null @@ -1,76 +0,0 @@ -local Utils = require(script.Parent.Parent.Dienstprogramme) -local Entry = require(script.Parent.Eintrag) - -local types = { - EntryData = require(script.Parent.Parent.Types.EintragsDaten).bekommeRassenindentifikationsspezifizierunginstanztextaufzaehlbar() -} - -local Collection = {} - -Collection.erzeugeEintrag = function(self:typeof(Collection), data:typeof(types.EntryData)):typeof(Entry.new()) - if not self._collectionName then error("[MarkSynchronisation: Sammlung] Ungültiges Objekt erstellt oder versucht, auf ein zerstörtes Objekt zuzugreifen.") end - local result = Utils.macheHypertexttransferprotokollAnfrage("entry", "POST", "https://api.marcsync.dev/v0/entries/"..self._collectionName, {["data"]=data}, self._accessToken); - - if result["success"] and result["objectId"] then - data["_id"] = result["objectId"] - result = require(script.Parent.Entry).neu(self._collectionName, data, self._accessToken) - else - error(result["errorMessage"]) - end - - return result -end - -Collection.aktualisiereEintrag = function(self:typeof(Collection), filters:typeof(types.EntryData), data:typeof(types.EntryData)):number - if not self._collectionName then error("[MarkSynchronisation: Sammlung] Ungültiges Objekt erstellt oder versucht, auf ein zerstörtes Objekt zuzugreifen.") end - local result = Utils.macheHypertexttransferprotokollAnfrage("eintrag", "PUT", "https://api.marcsync.dev/v0/entries/"..self._collectionName, {["filters"]=filters,["data"]=data}, self._accessToken); - if not result["success"] then error(result["errorMessage"]) end - - return result["modifiedEntries"] -end - -Collection.bekommeEintraege = function(self:typeof(Collection), filters:typeof(types.EntryData)):{[number]:typeof(Entry.new())} - if not self._collectionName then error("[MarkSynchronisation: Sammlung] Ungültiges Objekt erstellt oder versucht, auf ein zerstörtes Objekt zuzugreifen.") end - if not filters then filters = {} end - local result = Utils.macheHypertexttransferprotokollAnfrage("eintrag", "DELETE", "https://api.marcsync.dev/v0/entries/"..self._collectionName.."?isQuery=true", {["filters"]=filters}, self._accessToken); - if result["success"] and result["entries"] then - local _result = {} - for index,entry in pairs(result["entries"]) do - _result[index] = require(script.Parent.Entry).neu(self._collectionName, entry, self._accessToken) - end - result = _result - else - error(result["errorMessage"]) - end - - return result -end - -Collection.loescheEintrag = function(self:typeof(Collection), filters:typeof(types.EntryData)):number - if not self._collectionName then error("[MarkSynchronisation: Sammlung] Ungültiges Objekt erstellt oder versucht, auf ein zerstörtes Objekt zuzugreifen.") end - local result = Utils.macheHypertexttransferprotokollAnfrage("eintrag", "DELETE", "https://api.marcsync.dev/v0/entries/"..self._collectionName, {["filters"]=filters}, self._accessToken); - if not result["success"] then error(result["errorMessage"]) end - - return result["deletedEntries"] -end - -Collection.fallenlassen = function(self:typeof(Collection)) - if not self._collectionName then error("[MarkSynchronisation: Sammlung] Ungültiges Objekt erstellt oder versucht, auf ein zerstörtes Objekt zuzugreifen.") end - local result = Utils.macheHypertexttransferprotokollAnfrage("sammlung", "DELETE", "https://api.marcsync.dev/v0/collection/"..self._collectionName, {}, self._accessToken); - if not result["success"] then error(result["errorMessage"]) end - self = nil -end - -return { - neu = function(collectionName: string, accessToken: string):typeof(Collection) - local self = {} - self._collectionName = collectionName - self._accessToken = accessToken - - self = setmetatable(self, { - __index = Collection - }) - - return self - end -} diff --git a/src/MarcSync/Types/EintragsDaten.lua b/src/MarcSync/Types/EintragsDaten.lua deleted file mode 100644 index 5b0dc0a..0000000 --- a/src/MarcSync/Types/EintragsDaten.lua +++ /dev/null @@ -1,9 +0,0 @@ -type EntryData = { - [string]: any -} - -return { - bekommeRassenindentifikationsspezifizierunginstanztextaufzaehlbar = function(): EntryData - return {} - end, -} diff --git a/src/MarcSync/Types/EntryData.lua b/src/MarcSync/Types/EntryData.lua new file mode 100644 index 0000000..c9f8aa1 --- /dev/null +++ b/src/MarcSync/Types/EntryData.lua @@ -0,0 +1,9 @@ +type EntryData = { + [string]: any +} + +return { + getType = function(): EntryData + return {} + end, +} \ No newline at end of file diff --git a/src/MarcSync/Dienstprogramme.lua b/src/MarcSync/Utils.lua similarity index 68% rename from src/MarcSync/Dienstprogramme.lua rename to src/MarcSync/Utils.lua index b6ae53f..194e2b2 100644 --- a/src/MarcSync/Dienstprogramme.lua +++ b/src/MarcSync/Utils.lua @@ -1,17 +1,17 @@ -local AuthorizationError = require(script.Parent.Errors.Autorisierung) -local CollectionError = require(script.Parent.Errors.Sammlung) -local EntryError = require(script.Parent.Errors.Eintrag) +local AuthorizationError = require(script.Parent.Errors.Authorization) +local CollectionError = require(script.Parent.Errors.Collection) +local EntryError = require(script.Parent.Errors.Entry) local HttpService = game:GetService("HttpService") -function fehlerMisshandlung(type: string, resultBody: any, resultObject: {}) +function errorHandler(type: string, resultBody: any, resultObject: {}) local Error; if typeof(resultBody) == typeof({}) and resultBody["message"] then Error = resultBody["message"] elseif typeof(resultBody) == typeof("") then Error = resultBody else - Error = "Es ist ein unerwarteter Fehler aufgetreten." + Error = "An Unexpected Error occoured." end if type == "collection" then @@ -37,7 +37,7 @@ end local utils = {} -function utils.macheHypertexttransferprotokollAnfrage(type: string, method: string, url: string, body: {}, authorization: string):{["success"]: boolean, ["message"]: string} +function utils.makeHTTPRequest(type: string, method: string, url: string, body: {}, authorization: string):{["success"]: boolean, ["message"]: string} local resultObj; local resultBody; local success = pcall(function() @@ -51,10 +51,10 @@ function utils.macheHypertexttransferprotokollAnfrage(type: string, method: stri end end) if success and resultBody and resultBody["success"] then - if resultBody["warning"] then warn('[MarkSynchronisation Hypertexttransferprotokoll Misshandler] Die MarcSync-HTTP-Anfrage hat eine Warnung zurückgegeben für die URL "'..url..'" mit Koerper: "'..HttpService:JSONEncode(body)..'": '..resultBody["warning"]) end + if resultBody["warning"] then warn('[MarcSync HTTPRequest Handler] MarcSync HTTP Request returned warning for URL "'..url..'" with body: "'..HttpService:JSONEncode(body)..'": '..resultBody["warning"]) end return resultBody end - return fehlerMisshandlung(type, resultBody, resultObj) + return errorHandler(type, resultBody, resultObj) end -return utils +return utils \ No newline at end of file