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

Adding error messages for debug purposes #346

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Icaro-Lima
Copy link
Contributor

@Icaro-Lima Icaro-Lima commented Dec 2, 2018

My intention with this patch is to map error codes to friendlier error messages, just as they are in the current sgx documentation ( e.g. here) It is worth remembering that the error message will depend on the function that throws the error and the error code.

Currently, for most samples (here), you have put a list of errors in each app.cpp, taking much of the code and complicating it unnecessarily.

Some examples where something similar has been implemented:

icarolima added 6 commits December 2, 2018 04:10
Signed-off-by: Ícaro Dantas de Araújo Lima <icaro.lima@ccc.ufcg.edu.br>
Signed-off-by: Ícaro Dantas de Araújo Lima <icaro.lima@ccc.ufcg.edu.br>
Signed-off-by: Ícaro Dantas de Araújo Lima <icaro.lima@ccc.ufcg.edu.br>
Signed-off-by: Ícaro Dantas de Araújo Lima <icaro.lima@ccc.ufcg.edu.br>
Signed-off-by: Ícaro Dantas de Araújo Lima <icaro.lima@ccc.ufcg.edu.br>
Signed-off-by: Ícaro Dantas de Araújo Lima <icaro.lima@ccc.ufcg.edu.br>
@Icaro-Lima
Copy link
Contributor Author

I'm wondering if I should change the word "error" to "status". On the other hand, "SGX_SUCCESS" is in the file "sgx_error.h", even indicating success.

@andyzyb
Copy link
Contributor

andyzyb commented Dec 4, 2018

This patch is unlikely to be accepted since it is not clearly stating which problem to solve. If it is just to convert an error code to a string, then it doesn't seem provide much value.

@Icaro-Lima
Copy link
Contributor Author

I disagree, debug messages are one of the major reason for extensive code at least in the ones I write and in the sample codes from this repository. I'll edit the merge request message to make it clearer.

@pdxjohnny
Copy link
Member

I also think that this is useful. I did something similar and then went and looked at PRs and saw this. I think its important to have some function like this or the one I added (which is admittedly very basic). But some way of quickly doing an error code -> string of the message or string of the description. Preferably both

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.

None yet

3 participants