Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
MKCLOS
Core Development Platform
corepkgv2
Commits
5a656f4d
Commit
5a656f4d
authored
1 year ago
by
“prajwalp”
Browse files
Options
Downloads
Patches
Plain Diff
#14
return the error from CallServiceReturnABWithBranch method
parent
e89ada80
Branches
ab_Add_CallByBranch
Branches containing commit
Tags
Tags containing commit
2 merge requests
!282
Release v1.2.14
,
!281
#14 Return the error from CallServiceReturnABWithBranch method
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
routebuildermdl/serviceCachemdl.go
+9
-6
routebuildermdl/serviceCachemdl.go
with
9 additions
and
6 deletions
routebuildermdl/serviceCachemdl.go
+
9
−
6
View file @
5a656f4d
...
...
@@ -253,6 +253,7 @@ func CallServiceReturnABWithBranch(name, branch string, rs *gjson.Result, isRest
serviceCache
:=
tmpSvcCache
res
,
ab
,
err
:=
serviceCache
.
Service
(
rs
,
p
)
loggermdl
.
LogError
(
"error while calling activity:"
,
err
.
Error
())
if
errormdl
.
CheckErr1
(
err
)
!=
nil
{
// Rollback
if
ab
.
TransactionEnable
{
...
...
@@ -260,7 +261,7 @@ func CallServiceReturnABWithBranch(name, branch string, rs *gjson.Result, isRest
case
dalmdl
.
MYSQL
:
if
ab
.
TXN
!=
nil
{
loggermdl
.
LogError
(
"MYSQL Transaction Rollbacked"
)
err
=
ab
.
TXN
.
Rollback
()
err
:
=
ab
.
TXN
.
Rollback
()
if
err
!=
nil
{
loggermdl
.
LogError
(
"Error while rollback"
)
return
res
,
ab
,
errormdl
.
Wrap
(
"Error while rollback"
)
...
...
@@ -270,7 +271,7 @@ func CallServiceReturnABWithBranch(name, branch string, rs *gjson.Result, isRest
case
dalmdl
.
SQLSERVER
:
if
ab
.
SQLServerTXN
!=
nil
{
loggermdl
.
LogError
(
"SQLSERVER Transaction Rollbacked"
)
err
=
ab
.
SQLServerTXN
.
Rollback
()
err
:
=
ab
.
SQLServerTXN
.
Rollback
()
if
err
!=
nil
{
loggermdl
.
LogError
(
"Error while rollback"
)
return
res
,
ab
,
errormdl
.
Wrap
(
"Error while rollback"
)
...
...
@@ -280,7 +281,7 @@ func CallServiceReturnABWithBranch(name, branch string, rs *gjson.Result, isRest
case
dalmdl
.
GraphDB
:
if
ab
.
GraphDbTXN
!=
nil
{
loggermdl
.
LogError
(
"GRAPHDB Transaction Rollbacked"
)
err
=
ab
.
GraphDbTXN
.
Discard
(
context
.
TODO
())
err
:
=
ab
.
GraphDbTXN
.
Discard
(
context
.
TODO
())
if
err
!=
nil
{
loggermdl
.
LogError
(
"Error while rollback"
)
return
res
,
ab
,
errormdl
.
Wrap
(
"Error while rollback"
)
...
...
@@ -291,6 +292,7 @@ func CallServiceReturnABWithBranch(name, branch string, rs *gjson.Result, isRest
loggermdl
.
LogError
(
"Invalid database type while rollback transaction"
)
}
}
return
res
,
ab
,
err
//returning error
}
else
{
if
ab
.
TransactionEnable
{
// Commit
...
...
@@ -298,7 +300,7 @@ func CallServiceReturnABWithBranch(name, branch string, rs *gjson.Result, isRest
case
dalmdl
.
MYSQL
:
if
ab
.
TXN
!=
nil
{
loggermdl
.
LogError
(
"MYSQL Transaction Commited"
)
err
=
ab
.
TXN
.
Commit
()
err
:
=
ab
.
TXN
.
Commit
()
if
err
!=
nil
{
loggermdl
.
LogError
(
"Error while commit"
)
return
res
,
ab
,
errormdl
.
Wrap
(
"Error while commit"
)
...
...
@@ -308,7 +310,7 @@ func CallServiceReturnABWithBranch(name, branch string, rs *gjson.Result, isRest
case
dalmdl
.
SQLSERVER
:
if
ab
.
SQLServerTXN
!=
nil
{
loggermdl
.
LogError
(
"SQLSERVER Transaction Commited"
)
err
=
ab
.
SQLServerTXN
.
Commit
()
err
:
=
ab
.
SQLServerTXN
.
Commit
()
if
err
!=
nil
{
loggermdl
.
LogError
(
"Error while commit"
)
return
res
,
ab
,
errormdl
.
Wrap
(
"Error while commit"
)
...
...
@@ -318,7 +320,7 @@ func CallServiceReturnABWithBranch(name, branch string, rs *gjson.Result, isRest
case
dalmdl
.
GraphDB
:
if
ab
.
GraphDbTXN
!=
nil
{
loggermdl
.
LogError
(
"GRAPHDB Transaction Commited"
)
err
=
ab
.
GraphDbTXN
.
Commit
(
context
.
TODO
())
err
:
=
ab
.
GraphDbTXN
.
Commit
(
context
.
TODO
())
if
err
!=
nil
{
loggermdl
.
LogError
(
"Error while commit"
)
return
res
,
ab
,
errormdl
.
Wrap
(
"Error while commit"
)
...
...
@@ -331,5 +333,6 @@ func CallServiceReturnABWithBranch(name, branch string, rs *gjson.Result, isRest
}
}
}
return
res
,
ab
,
nil
}
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets