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

Improve error handling to distinguishes errors #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

anishagg17
Copy link

@anishagg17 anishagg17 commented May 22, 2021

Fixes: #9

Used cxx-binding to throw custom errors.

Signed-off-by: Anish Aggarwal anish17122000@gmail.com

@@ -21,7 +21,7 @@ run-example: target/tikv-example
RUST_LOG=debug $(cur_makefile_path)/target/tikv-example

target/tikv-example: target/debug/libtikv_client.a example/main.cpp
c++ $(cur_makefile_path)/example/main.cpp -o $(cur_makefile_path)/target/tikv-example -std=c++17 -g -I$(cur_makefile_path)/include -L$(cur_makefile_path)/target/debug -ltikv_client -lpthread -ldl -lssl -lcrypto
c++ $(cur_makefile_path)/example/main.cpp -o $(cur_makefile_path)/target/tikv-example -std=c++17 -g -I$(cur_makefile_path)/include -L$(cur_makefile_path)/target/debug -ltikv_client -lpthread -ldl -L/usr/local/opt/openssl/lib -I/usr/local/opt/openssl/include -lssl -lcrypto
Copy link
Author

Choose a reason for hiding this comment

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

I had to manually link ssl and lcrypto libraries so had to change this but will revert it as soon as other changes are approved.

func();
} catch (const std::exception &e) {
start error_message = e.what();
int error_code = 0;
Copy link
Author

Choose a reason for hiding this comment

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

How should we get the error_code via stl: map or using string comparison?

Copy link
Collaborator

Choose a reason for hiding this comment

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

We need to define the error_code on rust binding and pass it to the cpp glue.

Signed-off-by: Anish Aggarwal <anish17122000@gmail.com>
@anishagg17
Copy link
Author

Hi @andylokandy, I have withdrawn my application for the program but would still like to get this one completed if it's okay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Question: How to handle error thrown by TiKV
2 participants