diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2014-07-23 21:15:48 +0000 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2014-07-23 21:15:48 +0000 |
commit | 995eb6d91740dfda77e738334a046d813c982150 (patch) | |
tree | 7288518e82309b63323404f272ff7f545b44d5c8 /libgphoto2/gphoto2-camera.c | |
parent | 9e91489b701f29f964bb6e882c15810f052f7958 (diff) | |
download | libgphoto2-995eb6d91740dfda77e738334a046d813c982150.tar.gz |
From: Axel Waggershauser <awagger@web.de>
rewrote the ptp_opensession error retry code
changed some more error logging handling
detailed:
a) yet another logging/cleanup patch improving the code and error log
readability in this specific situation:
* extend translate_ptp_results to better handle PTP_ERROR_IO
* log the failure of ptp_opensession
* make the ptp_opensession error handling code clearer
* don't report a 'ptp_port' error inside the CHECK_INIT macro
when gp_camera_init fails in gphoto-camera.c. There is no
port error string mechanism involved and the original error has
been reported already from inside camera_init
* don't report the source location when logging the error string
inside gp_context_error(). interesting would be the original
source location but that is not available there.
* remove one of two different strings conveying the same
information: 'No additional information available.' and
'No error description available'
* improve logging in existing CHECK_RESULT_OPEN_CLOSE macro
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15110 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'libgphoto2/gphoto2-camera.c')
-rw-r--r-- | libgphoto2/gphoto2-camera.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/libgphoto2/gphoto2-camera.c b/libgphoto2/gphoto2-camera.c index e74419558..2ff39fcb6 100644 --- a/libgphoto2/gphoto2-camera.c +++ b/libgphoto2/gphoto2-camera.c @@ -73,17 +73,13 @@ int r1 = (result); \ \ if (r1 < 0) { \ - \ /* libgphoto2_port doesn't have a GPContext */ \ - if (r1 > -100) \ - gp_context_error ((ctx), _("An error occurred " \ - "in the io-library ('%s'): %s"), \ - gp_port_result_as_string (r1), \ - (c) ? gp_port_get_error ((c)->port) : \ - _("No additional information " \ - "available.")); \ + gp_context_error ((ctx), _("An error occurred " \ + "in the io-library ('%s'): %s"), \ + gp_port_result_as_string (r1), \ + gp_port_get_error ((c) ? (c)->port : NULL)); \ if (c) \ - CAMERA_UNUSED((c),(ctx)); \ + CAMERA_UNUSED (c,ctx); \ return (r1); \ } \ } @@ -203,8 +199,8 @@ CHECK_OPEN (c,ctx); \ r6 = (result); \ if (r6 < 0) { \ + GP_LOG_E ("'%s' failed: %d", #result, r6); \ CHECK_CLOSE (c,ctx); \ - GP_LOG_E ("Operation failed!"); \ CAMERA_UNUSED (c,ctx); \ return (r6); \ } \ |