Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users
Skins
  • Light
  • Brite
  • 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
  1. Home
  2. Cloud Code
  3. Is there a place I can see all possible error code that can come back from various APIs?

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 2.0k Views 3 Watching
  • 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

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

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