@dazn/kopytko-framework 3.2.0 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -32,11 +32,16 @@ sub handleResponse(response as Object)
|
|
|
32
32
|
result = CreateObject("roSGNode", "HttpRequestResultModel")
|
|
33
33
|
result.isSuccess = response.isSuccess
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
try
|
|
36
|
+
if (response.isSuccess)
|
|
37
|
+
result.data = parseResponse(response)
|
|
38
|
+
else
|
|
39
|
+
result.data = generateErrorData(response)
|
|
40
|
+
end if
|
|
41
|
+
catch error
|
|
42
|
+
result.isSuccess = false
|
|
43
|
+
result.data = generateParseErrorData(response, error)
|
|
44
|
+
end try
|
|
40
45
|
|
|
41
46
|
m.top.result = result
|
|
42
47
|
end sub
|
|
@@ -42,6 +42,11 @@ function generateErrorData(response as Object) as Object
|
|
|
42
42
|
return response
|
|
43
43
|
end function
|
|
44
44
|
|
|
45
|
+
' Override by child for returning a specific data structure and/or node type
|
|
46
|
+
function generateParseErrorData(response as Object, _error as Object) as Object
|
|
47
|
+
return response
|
|
48
|
+
end function
|
|
49
|
+
|
|
45
50
|
sub _onDataChange(event as Object)
|
|
46
51
|
data = event.getData()
|
|
47
52
|
|