From f2f1b36df93b10a0d47c20ad19959fb261c18f48 Mon Sep 17 00:00:00 2001 From: Thomas Geymayer Date: Sat, 21 Jun 2014 00:21:36 +0200 Subject: [PATCH] Nasal: better error message for non-numeric string. --- simgear/nasal/code.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/simgear/nasal/code.c b/simgear/nasal/code.c index 2f75220e..2bf46451 100644 --- a/simgear/nasal/code.c +++ b/simgear/nasal/code.c @@ -71,7 +71,9 @@ static double numify(naContext ctx, naRef o) else if(IS_NIL(o)) ERR(ctx, "nil used in numeric context"); else if(!IS_STR(o)) ERR(ctx, "non-scalar in numeric context"); else if(naStr_tonum(o, &n)) return n; - else ERR(ctx, "non-numeric string in numeric context"); + else naRuntimeError( ctx, + "non-numeric string in numeric context: '%s'", + naStr_data(o) ); return 0; } -- 2.39.5