mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-11-24 14:35:47 +00:00
refactor: improve broadcast error logging
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
This commit is contained in:
parent
35c30e4edb
commit
140d77b234
@ -33,12 +33,16 @@ func buildSignBroadcastTx(goCtx context.Context, loggingContext string, sendingV
|
||||
GetAppLogger().Error(ctx, loggingContext+" getting tx response from out failed: "+err.Error())
|
||||
return
|
||||
}
|
||||
if txResponse.Code == 0 {
|
||||
GetAppLogger().Info(ctx, loggingContext+" broadcast tx succeeded")
|
||||
return
|
||||
}
|
||||
txResponseJSON, err := yaml.YAMLToJSON([]byte(txResponse.String()))
|
||||
if err != nil {
|
||||
GetAppLogger().Error(ctx, loggingContext+" converting tx response from yaml to json failed: "+err.Error())
|
||||
return
|
||||
}
|
||||
GetAppLogger().Info(ctx, loggingContext+" broadcast tx succeeded: "+string(txResponseJSON))
|
||||
GetAppLogger().Error(ctx, loggingContext+" broadcast tx failed: "+string(txResponseJSON))
|
||||
}()
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user