Skip to content
TORNLIFE More

API response typo - Error code 2

Started by DokuganRyu [563000] on in Bugs & Issues.

7 replies · 56 views · thread synced · 4 days ago · View on torn.com
About this thread

Posts archived: 8 / 8 posts (100%) · the total is Torn's reply count + the opening post at the last fetch

Counted by TornLife from the archived posts.

Archived posts
8
Discussion span
→
People posting
5
Likes on archived posts
5
Posts by staff, officers and moderators
3
Authority score
59 / 100
Historical score
30 / 100
Story score
38 / 100
Engagement score
47 / 100

Most-liked replies

DokuganRyu [563000]

[image: i.imgur.com]

Steps to reproduce:
  • 1) Make an API call with an invalid API key
  • 2) ???
  • 3) Profit...?
Devs please, I'm an inexperienced and too lazy of a programmer to handle this myself... I know English can be hard but my program is looking bad because of you.
LITERALLY UNPROGRAMMABLE!!
Chedburn [1] Admin Developer

So you're using the API with an invalid key, and receive a response saying it's an invalid key. What's the issue?
shro [1332742]

I've had this happen before when trying to use curl from the command line and not properly escaping the string with single quotes (as opposed to double quotes or not using quotes).
shro [1332742]

Oh. That could have been stated much more clearly. Maybe the original poster could use

if (response.error.code == 2) response.error.error = "unprogrammable?";
Chedburn [1] Admin Developer

I believe the "16 char" reference can now be removed. So we could change it to very simply: "Incorrect key" and nothing more.