Skip to content

Conversation

@Jim8y
Copy link
Contributor

@Jim8y Jim8y commented Dec 17, 2024

Description

This pr fixes #3629 to handle rpcexception catch.

Fixes # #3629

Type of change

  • Optimization (the change is only an optimization)
  • Style (the change is only a code style for better maintenance or standard purpose)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • TestInvokeFunctionInvalid

Test Configuration:

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

args[i] = param.DefaultValue;
}
else if (param.ParameterType.IsValueType && Nullable.GetUnderlyingType(param.ParameterType) == null)
else if (param.ParameterType.IsValueType &&
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are made automatically by dotnet format.

Comment on lines 378 to 381
catch (RpcException ex)
{
return CreateErrorResponse(request["id"], ex.GetError());
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

core update is here

Hecate2
Hecate2 previously approved these changes Dec 17, 2024
Copy link
Contributor

@Hecate2 Hecate2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be better if ParameterConverter.ConvertParameter throws something else, instead of RpcException.

Copy link
Contributor

@roman-khimov roman-khimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's gonna be the HTTP return code this way? 200?

@Hecate2
Copy link
Contributor

Hecate2 commented Dec 17, 2024

What's gonna be the HTTP return code this way? 200?

200 with an error code like -32602 in the json response body

Copy link
Member

@superboyiii superboyiii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works correctly, although it changes the original behaviour for message. I'm not sure it's good or not since these messages are not useless for debug.
Original(v3.7.5):
38cab1448ae3a80926cbe334a897253
Current:
c9912bc94db6e7d3122e2975745065d

@nan01ab
Copy link
Contributor

nan01ab commented Dec 17, 2024

LGTM

@Jim8y Jim8y removed the Need Update label Dec 19, 2024
@NGDAdmin NGDAdmin merged commit 61de3a4 into neo-project:master Dec 19, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

All exception for RPC now all return code 500

8 participants