Skip to content

Commit

Permalink
change to badRequestErrors
Browse files Browse the repository at this point in the history
  • Loading branch information
pivilartisant committed Dec 6, 2024
1 parent c84602f commit 1c4f768
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions int/api/cmd/deploySC.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type deploySC struct {
func (d *deploySC) Handle(params operations.CmdDeploySCParams) middleware.Responder {
smartContractByteCode, err := base64.StdEncoding.DecodeString(params.Body.SmartContract)
if err != nil {
return operations.NewCmdDeploySCInternalServerError().
return operations.NewCmdDeploySCBadRequest().
WithPayload(
&models.Error{
Code: err.Error(),
Expand All @@ -38,7 +38,7 @@ func (d *deploySC) Handle(params operations.CmdDeploySCParams) middleware.Respon

parameters, err := base64.StdEncoding.DecodeString(params.Body.Parameters)
if err != nil {
return operations.NewCmdDeploySCInternalServerError().
return operations.NewCmdDeploySCBadRequest().
WithPayload(
&models.Error{
Code: err.Error(),
Expand All @@ -48,7 +48,7 @@ func (d *deploySC) Handle(params operations.CmdDeploySCParams) middleware.Respon

maxCoins, err := strconv.ParseUint(*params.Body.MaxCoins, 10, 64)
if err != nil {
return operations.NewCmdDeploySCInternalServerError().
return operations.NewCmdDeploySCBadRequest().
WithPayload(
&models.Error{
Code: err.Error(),
Expand All @@ -58,7 +58,7 @@ func (d *deploySC) Handle(params operations.CmdDeploySCParams) middleware.Respon

coins, err := strconv.ParseUint(*params.Body.Coins, 10, 64)
if err != nil {
return operations.NewCmdDeploySCInternalServerError().
return operations.NewCmdDeploySCBadRequest().
WithPayload(
&models.Error{
Code: err.Error(),
Expand All @@ -68,7 +68,7 @@ func (d *deploySC) Handle(params operations.CmdDeploySCParams) middleware.Respon

fee, err := strconv.ParseUint(*params.Body.Fee, 10, 64)
if err != nil {
return operations.NewCmdDeploySCInternalServerError().
return operations.NewCmdDeploySCBadRequest().
WithPayload(
&models.Error{
Code: err.Error(),
Expand Down

0 comments on commit 1c4f768

Please sign in to comment.