forked from urdt/ussd
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)
|
||||
|
||||
ctx := context.Background()
|
||||
st := state.NewState(14)
|
||||
st := state.NewState(15)
|
||||
st.UseDebug()
|
||||
state.FlagDebugger.Register(models.USERFLAG_LANGUAGE_SET, "LANGUAGE_CHANGE")
|
||||
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_VALIDPIN,"VALIDPIN")
|
||||
state.FlagDebugger.Register(models.USERFLAG_VALIDPIN,"ACCOUNTUNLOCKED")
|
||||
|
||||
|
||||
state.FlagDebugger.Register(models.USERFLAG_ACCOUNT_CREATION_FAILED,"ACCOUNT_CREATION_FAILED")
|
||||
|
||||
rfs := resource.NewFsResource(scriptDir)
|
||||
ca := cache.NewCache()
|
||||
|
@ -64,7 +64,7 @@ func (h *Handlers) CreateAccount(ctx context.Context, sym string, input []byte)
|
||||
|
||||
accountResp, err := server.CreateAccount()
|
||||
if err != nil {
|
||||
fmt.Println("Failed to create account:", err)
|
||||
res.FlagSet = append(res.FlagSet, models.USERFLAG_ACCOUNT_CREATION_FAILED)
|
||||
return res, err
|
||||
}
|
||||
|
||||
|
@ -17,4 +17,5 @@ const (
|
||||
USERFLAG_VALIDPIN
|
||||
USERFLAG_PINMISMATCH
|
||||
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
|
||||
CATCH account_creation_failed 22 1
|
||||
MOUT exit 0
|
||||
HALT
|
||||
LOAD save_pin 0
|
||||
|
Loading…
Reference in New Issue
Block a user