Added a CATCH if the account creation fails
This commit is contained in:
parent
7e95e7cbb3
commit
bf99ed8482
@ -33,7 +33,7 @@ func main() {
|
|||||||
fmt.Fprintf(os.Stderr, "starting session at symbol '%s' using resource dir: %s\n", root, dir)
|
fmt.Fprintf(os.Stderr, "starting session at symbol '%s' using resource dir: %s\n", root, dir)
|
||||||
|
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
st := state.NewState(14)
|
st := state.NewState(15)
|
||||||
st.UseDebug()
|
st.UseDebug()
|
||||||
state.FlagDebugger.Register(models.USERFLAG_LANGUAGE_SET, "LANGUAGE_CHANGE")
|
state.FlagDebugger.Register(models.USERFLAG_LANGUAGE_SET, "LANGUAGE_CHANGE")
|
||||||
state.FlagDebugger.Register(models.USERFLAG_ACCOUNT_CREATED, "ACCOUNT_CREATED")
|
state.FlagDebugger.Register(models.USERFLAG_ACCOUNT_CREATED, "ACCOUNT_CREATED")
|
||||||
@ -49,8 +49,7 @@ func main() {
|
|||||||
state.FlagDebugger.Register(models.USERFLAG_UNLOCKFORUPDATE,"UNLOCKFORUPDATE")
|
state.FlagDebugger.Register(models.USERFLAG_UNLOCKFORUPDATE,"UNLOCKFORUPDATE")
|
||||||
state.FlagDebugger.Register(models.USERFLAG_VALIDPIN,"VALIDPIN")
|
state.FlagDebugger.Register(models.USERFLAG_VALIDPIN,"VALIDPIN")
|
||||||
state.FlagDebugger.Register(models.USERFLAG_VALIDPIN,"ACCOUNTUNLOCKED")
|
state.FlagDebugger.Register(models.USERFLAG_VALIDPIN,"ACCOUNTUNLOCKED")
|
||||||
|
state.FlagDebugger.Register(models.USERFLAG_ACCOUNT_CREATION_FAILED,"ACCOUNT_CREATION_FAILED")
|
||||||
|
|
||||||
|
|
||||||
rfs := resource.NewFsResource(scriptDir)
|
rfs := resource.NewFsResource(scriptDir)
|
||||||
ca := cache.NewCache()
|
ca := cache.NewCache()
|
||||||
|
@ -64,7 +64,7 @@ func (h *Handlers) CreateAccount(ctx context.Context, sym string, input []byte)
|
|||||||
|
|
||||||
accountResp, err := server.CreateAccount()
|
accountResp, err := server.CreateAccount()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Failed to create account:", err)
|
res.FlagSet = append(res.FlagSet, models.USERFLAG_ACCOUNT_CREATION_FAILED)
|
||||||
return res, err
|
return res, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,4 +17,5 @@ const (
|
|||||||
USERFLAG_VALIDPIN
|
USERFLAG_VALIDPIN
|
||||||
USERFLAG_PINMISMATCH
|
USERFLAG_PINMISMATCH
|
||||||
USERFLAG_INCORRECTDATEFORMAT
|
USERFLAG_INCORRECTDATEFORMAT
|
||||||
|
USERFLAG_ACCOUNT_CREATION_FAILED
|
||||||
)
|
)
|
||||||
|
1
services/registration/account_creation_failed
Normal file
1
services/registration/account_creation_failed
Normal file
@ -0,0 +1 @@
|
|||||||
|
Your account creation request failed. Please try again later.
|
3
services/registration/account_creation_failed.vis
Normal file
3
services/registration/account_creation_failed.vis
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
MOUT quit 9
|
||||||
|
HALT
|
||||||
|
INCMP quit 9
|
1
services/registration/account_creation_failed_swa
Normal file
1
services/registration/account_creation_failed_swa
Normal file
@ -0,0 +1 @@
|
|||||||
|
Ombi lako la kusajiliwa haliwezi kukamilishwa. Tafadhali jaribu tena baadaye.
|
@ -1,4 +1,5 @@
|
|||||||
LOAD create_account 0
|
LOAD create_account 0
|
||||||
|
CATCH account_creation_failed 22 1
|
||||||
MOUT exit 0
|
MOUT exit 0
|
||||||
HALT
|
HALT
|
||||||
LOAD save_pin 0
|
LOAD save_pin 0
|
||||||
|
Loading…
Reference in New Issue
Block a user