From 43a5fc9fe7db4f97f4ff84e9a3092887c739a5b3 Mon Sep 17 00:00:00 2001 From: "Wilma456 (Jakob0815)" Date: Tue, 18 Jul 2017 16:12:19 +0200 Subject: [PATCH] Better Error for "Invalid color" the "Invalid color" error now contain the wrong color. --- .../resources/assets/computercraft/lua/rom/apis/window.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/assets/computercraft/lua/rom/apis/window.lua b/src/main/resources/assets/computercraft/lua/rom/apis/window.lua index eaac77eae..b9d6d59d6 100644 --- a/src/main/resources/assets/computercraft/lua/rom/apis/window.lua +++ b/src/main/resources/assets/computercraft/lua/rom/apis/window.lua @@ -274,7 +274,7 @@ function create( parent, nX, nY, nWidth, nHeight, bStartVisible ) if type( color ) ~= "number" then error( "bad argument #1 (expected number, got " .. type( color ) .. ")", 2 ) elseif tHex[color] == nil then - error( "Invalid color", 2 ) + error( "Invalid color (got " .. color .. ")" , 2 ) end nTextColor = color if bVisible then @@ -321,7 +321,7 @@ function create( parent, nX, nY, nWidth, nHeight, bStartVisible ) if type( color ) ~= "number" then error( "bad argument #1 (expected number, got " .. type( color ) .. ")", 2 ) elseif tHex[color] == nil then - error( "Invalid color", 3 ) + error( "Invalid color (got " .. color .. ")", 2 ) end nBackgroundColor = color end