-
Notifications
You must be signed in to change notification settings - Fork 539
Printing exact error for clean file. #529
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
Conversation
|
This is a good idea, but instead of using perror() use print_error() -as in the line above-. You can get the text from sterror (). Problem with perror() is that it always uses stderr which may be closed, or the user may have requested -quiet mode, etc. |
|
@cfsmp3 Thank you! :) I used perror() because when fopen returns with an error, it sets the variable errno with some number which contains the exact message (like permission denies etc.). But I see the problem.
Shall I replace it with :
|
|
You can use two print_error lines for clarity, but that's OK.
Just try it though - try writing to a non existing directory to confirm you
get the text explanation.
…On Tue, Dec 13, 2016 at 10:59 PM, Saurabh Shrivastava < ***@***.***> wrote:
@cfsmp3 <https://github.com/cfsmp3> Thank you! :)
I used perror() because when fopen returns with an error, it sets the
variable errno with some number which contains the exact message (like
permission denies etc.). But I see the problem.
print_error(CCX_COMMON_EXIT_FILE_CREATION_FAILED, "Unable to open clean
file: %s\n", cfg->out_elementarystream_filename);
perror("Details : ");
Shall I replace it with :
print_error(CCX_COMMON_EXIT_FILE_CREATION_FAILED, "Unable to open clean
file: %s \n. Details : %s \n", cfg->out_elementarystream_
filename,strerror(errno));
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#529 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFrJ2QH17x9DVLYbZCOJXV31nRi74_xiks5rH5O_gaJpZM4LLg0k>
.
|
|
@cfsmp3 I tried and it worked. :) Now, I have formatted the output to remove that 'space' and '.' before 'Deatils' It will now appear as : If it looks good to you, shall I send a PR? EDIT: Not using two print_error lines because if we supply mode (CCX_COMMON_EXIT_FILE_CREATION_FAILED), it displays :
and if we don't, i.e. mode (0), it displays :
I think the 'single line' implementation produces cleaner result and also, the function is only called once. :) |
|
@cfsmp3 Thanks :) |
Bumps [sqlalchemy](https://github.com/sqlalchemy/sqlalchemy) from 1.4.5 to 1.4.7. - [Release notes](https://github.com/sqlalchemy/sqlalchemy/releases) - [Changelog](https://github.com/sqlalchemy/sqlalchemy/blob/master/CHANGES) - [Commits](https://github.com/sqlalchemy/sqlalchemy/commits) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Removes ambiguity as of why unable to open clean file. Gives better aid in resolving the issue.
Example : I have attached a console log below of 4 different runs. fopenerror.txt