• Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Darkly)
  • No Skin
Collapse
brainCloud Forums

Is there a place I can see all possible error code that can come back from various APIs?

Scheduled Pinned Locked Moved Unsolved Cloud Code
cloud codeerror
5 Posts 3 Posters 600 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kuabs
    wrote on last edited by
    #1

    I'm trying to handle my game logic exclusively through cloud code.
    I know the default response has 200 in it, if we are using bridges/proxies and encounter a failure within the script, should we also set the main response status to some code other than 200?

    Also is there a way to simulate failures for testing? IE blocked network etc. I see the docs have some of the error codes that can be found, but it doesn't seem exhaustive.

    As always any adivce is appreciated!

    1 Reply Last reply
    0
  • J Offline
    J Offline
    JasonL bitHeads
    wrote on last edited by
    #2

    Note that the response status code for running a script indicates whether the script has been executed successfully or not. To return the status of the internal methods that were executed, it is usually to include them in the customized response.
    The best place to debug your cloud code script is the portal script editor, which can show the stack trace of your code, also the logs you added.

    1 Reply Last reply
    0
  • K Offline
    K Offline
    kuabs
    wrote on last edited by
    #3

    Thanks @JasonL -- just to clarify, that means that the base response status code is just whether or not the script itself was properly executed by the request, so the only exception would be like if the user wasn't authenticated or a network timeout, is that right? It doesn't account for anything like if a proxy/bridge request that was made within the script failed-- that we should include ourselves in a custom response/error field. Right?

    1 Reply Last reply
    0
  • J Offline
    J Offline
    JasonL bitHeads
    wrote on last edited by
    #4

    Exactly, the error status code returned from the individual method can be incorporated into the script response.

    1 Reply Last reply
    0
  • Paul WinterhalderP Offline
    Paul WinterhalderP Offline
    Paul Winterhalder brainCloudAdmin
    wrote on last edited by
    #5

    There is a global list of reason codes here - https://docs.braincloudservers.com/api/appendix/reasonCodes

    1 Reply Last reply
    0

  • Login

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users