From 839ad49a05a7d42b405a3c3da55f0d66b0c1aab8 Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Fri, 22 Dec 2017 11:18:46 +0000 Subject: [PATCH] Remove all ocurrences of SPANK from our user facing errors. This has been bugging me for some time but now we are triggering new errors internally this is appearing to end users for problems they did not cause. Additionally I was able to improve a couple of the errors by copying the explanation from code comments into the error message. Shorter error logs now too :) --- src/lib/ecore/ecore.c | 4 +--- src/lib/ecore/ecore_exe_posix.c | 9 ++------- src/lib/edje/edje_load.c | 2 +- src/lib/edje/edje_program.c | 2 +- src/lib/eina/eina_magic.c | 20 ++++---------------- src/tests/eina/eina_test_magic.c | 15 +++------------ 6 files changed, 12 insertions(+), 40 deletions(-) diff --git a/src/lib/ecore/ecore.c b/src/lib/ecore/ecore.c index 26a7481..85040f5 100644 --- a/src/lib/ecore/ecore.c +++ b/src/lib/ecore/ecore.c @@ -801,9 +801,7 @@ _ecore_magic_fail(const void *d, " Supplied: %08x - %s", (unsigned int)req_m, _ecore_magic_string_get(req_m), (unsigned int)m, _ecore_magic_string_get(m)); - ERR("*** NAUGHTY PROGRAMMER!!!\n" - "*** SPANK SPANK SPANK!!!\n" - "*** Now go fix your code. Tut tut tut!"); + if (getenv("ECORE_ERROR_ABORT")) abort(); } diff --git a/src/lib/ecore/ecore_exe_posix.c b/src/lib/ecore/ecore_exe_posix.c index 2d8fa98..a9332d1 100644 --- a/src/lib/ecore/ecore_exe_posix.c +++ b/src/lib/ecore/ecore_exe_posix.c @@ -180,9 +180,7 @@ _ecore_exe_check_errno(int result, case EPERM: case EBUSY: { /* Programmer fucked up. */ - ERR("*** NAUGHTY PROGRAMMER!!!\n" - "*** SPANK SPANK SPANK!!!\n" - "*** Now go fix your code in %s @%u. Tut tut tut!", + ERR("*** Race condition between open() and dup() created in %s @%u.", file, line); result = 0; break; @@ -190,10 +188,7 @@ _ecore_exe_check_errno(int result, default: { /* Unsupported errno code, please add this one. */ - ERR("*** NAUGHTY PROGRAMMER!!!\n" - "*** SPANK SPANK SPANK!!!\n" - "*** Unsupported errno code %d, please add this one.\n" - "*** Now go fix your code in %s @%u, from %s @%u. Tut tut tut!", + ERR("*** Unsupported errno code %d, found in %s @%u, from %s @%u.", saved_errno, __FILE__, __LINE__, file, line); result = 0; break; diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c index 66ea7ba..010d559 100644 --- a/src/lib/edje/edje_load.c +++ b/src/lib/edje/edje_load.c @@ -1090,7 +1090,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch break; case EDJE_PART_TYPE_GRADIENT: - ERR("SPANK ! SPANK ! SPANK ! YOU ARE USING GRADIENT IN PART %s FROM GROUP %s INSIDE FILE %s !! THEY ARE NOW REMOVED !", + ERR("YOU ARE USING GRADIENT IN PART %s FROM GROUP %s INSIDE FILE %s !! THEY ARE NOW REMOVED !", ep->name, group, eina_file_filename_get(file)); break; diff --git a/src/lib/edje/edje_program.c b/src/lib/edje/edje_program.c index 2d67bd4..850a1e0 100644 --- a/src/lib/edje/edje_program.c +++ b/src/lib/edje/edje_program.c @@ -122,7 +122,7 @@ _edje_emit_child(Edje *ed, Edje_Real_Part *rp, const char *part, const char *sig break; default: - // ERR("SPANK SPANK SPANK !!!\nYou should never be here !"); + // ERR("Unknown part type. You should never be here!"); break; } return ed->collection->broadcast_signal; diff --git a/src/lib/eina/eina_magic.c b/src/lib/eina/eina_magic.c index 082e7f4..c191841 100644 --- a/src/lib/eina/eina_magic.c +++ b/src/lib/eina/eina_magic.c @@ -273,32 +273,23 @@ eina_magic_fail(void *d, eina_log_print(EINA_LOG_DOMAIN_GLOBAL, EINA_LOG_LEVEL_ERR, file, fnc, line, "*** Eina Magic Check Failed !!!\n" - " Input handle pointer is NULL !\n" - "*** NAUGHTY PROGRAMMER!!!\n" - "*** SPANK SPANK SPANK!!!\n" - "*** Now go fix your code. Tut tut tut!\n" + " Input handle pointer is NULL.\n" "\n"); else if (m == EINA_MAGIC_NONE) eina_log_print(EINA_LOG_DOMAIN_GLOBAL, EINA_LOG_LEVEL_CRITICAL, file, fnc, line, "*** Eina Magic Check Failed at %p !!!\n" - " Input handle has already been freed!\n" - "*** NAUGHTY PROGRAMMER!!!\n" - "*** SPANK SPANK SPANK!!!\n" - "*** Now go fix your code. Tut tut tut!\n" + " Input handle has already been freed.\n" "\n", d); else if (m != req_m) eina_log_print(EINA_LOG_DOMAIN_GLOBAL, EINA_LOG_LEVEL_CRITICAL, file, fnc, line, "*** Eina Magic Check Failed at %p !!!\n" - " Input handle is wrong type\n" + " Input handle is wrong type.\n" " Expected: %08x - %s\n" " Supplied: %08x - %s\n" - "*** NAUGHTY PROGRAMMER!!!\n" - "*** SPANK SPANK SPANK!!!\n" - "*** Now go fix your code. Tut tut tut!\n" "\n", d, req_m, eina_magic_string_get(req_m), m, eina_magic_string_get(m)); @@ -306,10 +297,7 @@ eina_magic_fail(void *d, eina_log_print(EINA_LOG_DOMAIN_GLOBAL, EINA_LOG_LEVEL_CRITICAL, file, fnc, line, "*** Eina Magic Check Failed !!!\n" - " Why did you call me !\n" - "*** NAUGHTY PROGRAMMER!!!\n" - "*** SPANK SPANK SPANK!!!\n" - "*** Now go fix your code. Tut tut tut!\n" + " Unknown reason.\n" "\n"); } diff --git a/src/tests/eina/eina_test_magic.c b/src/tests/eina/eina_test_magic.c index b6f8fdc..14a6f0d 100644 --- a/src/tests/eina/eina_test_magic.c +++ b/src/tests/eina/eina_test_magic.c @@ -148,10 +148,7 @@ START_TEST(eina_magic_simple) #endif TEST_MAGIC_SAFETY(__FUNCTION__, "*** Eina Magic Check Failed !!!\n" - " Input handle pointer is NULL !\n" - "*** NAUGHTY PROGRAMMER!!!\n" - "*** SPANK SPANK SPANK!!!\n" - "*** Now go fix your code. Tut tut tut!\n" + " Input handle pointer is NULL.\n" "\n"); EINA_MAGIC_FAIL(ems, EINA_MAGIC_TEST); fail_unless(ctx.did); @@ -169,10 +166,7 @@ START_TEST(eina_magic_simple) #endif TEST_MAGIC_SAFETY(__FUNCTION__, "*** Eina Magic Check Failed at %p !!!\n" - " Input handle has already been freed!\n" - "*** NAUGHTY PROGRAMMER!!!\n" - "*** SPANK SPANK SPANK!!!\n" - "*** Now go fix your code. Tut tut tut!\n" + " Input handle has already been freed.\n" "\n"); ctx.expected_level = EINA_LOG_LEVEL_CRITICAL; EINA_MAGIC_FAIL(ems, EINA_MAGIC_TEST); @@ -184,12 +178,9 @@ START_TEST(eina_magic_simple) #endif TEST_MAGIC_SAFETY(__FUNCTION__, "*** Eina Magic Check Failed at %p !!!\n" - " Input handle is wrong type\n" + " Input handle is wrong type.\n" " Expected: %08x - %s\n" " Supplied: %08x - %s\n" - "*** NAUGHTY PROGRAMMER!!!\n" - "*** SPANK SPANK SPANK!!!\n" - "*** Now go fix your code. Tut tut tut!\n" "\n"); ctx.expected_level = EINA_LOG_LEVEL_CRITICAL; EINA_MAGIC_FAIL(ems, EINA_MAGIC_TEST); -- 2.7.4