Skip to content

Commit

Permalink
Improve error messages & bump version
Browse files Browse the repository at this point in the history
Fixed two incorrect references:
- HTTP 4XX errors are usually the fault of the user (generally bad KEY/TOKEN pairs);

- For creating a card, the argument #3 is a list.

VERSION BUMP: 1.3.6
  • Loading branch information
ddavness committed Aug 29, 2019
1 parent 4e7b489 commit 81e93c7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Trello/Main.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local VERSION = "1.3.5"
local VERSION = "1.3.6"

local Trello = {}
local HTTP = game:GetService("HttpService")
Expand Down Expand Up @@ -34,7 +34,7 @@ else
elseif dummyResult.StatusCode >= 500 then
warn("Trello API - Bad Server Response - "..tostring(dummyResult.StatusCode)..". Service might experience issues.")
elseif dummyResult.StatusCode >= 400 then
warn("Trello API - Bad Client Request - "..tostring(dummyResult.StatusCode)..". Service might experience issues.")
warn("Trello API - Bad Client Request - "..tostring(dummyResult.StatusCode)..". Please check your authorization key/token pair!\nRead the auth module on how to get those.")
end
end

Expand All @@ -59,7 +59,7 @@ Trello.new = function(className, name, parent)
if parent:ClassName() == "List" then
return (ConList.Card.new({name = name, idList = parent:GetId()}, ConList["Board"], ConList["List"], ConList["Card"]))
else
error("Card - argument #3 is not a card.", 0)
error("Card - argument #3 is not a list.", 0)
end
else
error("Card - List not specified!", 0)
Expand Down
11 changes: 11 additions & 0 deletions Trello/auth.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
-- Getting the KEY/TOKEN pair:

-- The KEY field is MANDATORY: You can get yours here: https://trello.com/app-key

-- The TOKEN field is MANDATORY when:
-- -- You're trying to access a private board;
-- -- You're trying to write to a board (private or not).
-- You can leave it as an empty string if you're only READING FROM A PUBLIC BOARD.

-- Get your token here: https://trello.com/1/authorize?expiration=never&scope=read,write&response_type=token&name=Your%20Trello%20Application&key=<YOUR KEY HERE>

local KEY = ""
local TOKEN = ""

Expand Down

0 comments on commit 81e93c7

Please sign in to comment.