Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: error message from surrealdb and throw statement is not passed to client #175

Open
2 tasks done
agufagit opened this issue Nov 1, 2024 · 0 comments
Open
2 tasks done
Assignees
Labels
bug Something isn't working

Comments

@agufagit
Copy link

agufagit commented Nov 1, 2024

Describe the bug

error message from surrealdb and throw statement is not passed to client, instead we got cbor error message

cbor: cannot unmarshal UTF-8 text string into Go struct field connection.RPCResponse[[]github.com/surrealdb/surrealdb%2ego.QueryResult[bool]].result of type bool

Steps to reproduce

BEGIN;
CREATE t:1;
CREATE t:1;
RETURN true;
COMMIT;
BEGIN;
THROW "test";
RETURN true;
COMMIT;
result, err := surrealdb.Query[bool](conn, 
  `
  BEGIN;
  THROW "test";
  RETURN true;
  COMMIT;
  `, 
   map[string]any{})
if err != nil {
  if strings.Contains(err, 'test') {
    return nil, errors.New('test')
  }
}

Expected behaviour

error message from surealdb and throw statement is passed to client

The query was not executed due to a failed transaction
An error occurred: test

SurrealDB version

surreal 2.0.4

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@agufagit agufagit added the bug Something isn't working label Nov 1, 2024
@remade remade self-assigned this Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants