Jump to content

Search the Community

Showing results for tags 'Error handling'.

  • Search By Tags

    Type tags separated by commas.
    For example, the common name of the game: PUBG, Free Fire, Rules of Survival, Critical Ops, Mobile Legends: Bang Bang, etc.
  • Search By Author

Content Type


Forums

  • GameGuardian
    • Requests
    • Help
    • Guides
    • Cheats
    • Video Tutorials
    • Unintended Effects
  • General
    • General Discussion
    • Introduce yourself (:
    • Announcements
    • Website suggestions/Bugs
  • Downloads Support
    • Apps
    • LUA scripts
  • Online Multiplayer Mods
    • Altering Online Games with Gameguardian
    • Download Mods
  • Other Hacks
    • Tutorials
    • Non-GameGuardian
  • Archive
    • Archived topics

Categories

  • Official Downloads
  • Virtual spaces (no root)
  • LUA scripts
    • Forward Assault
    • Free Fire
    • PUBG
    • Rules of Survival
    • Templates
    • Tools
  • Test applications
  • Other

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Device


Discord ID

Found 2 results

  1. View File Error handling for GG API functions template Note: This file is intended to be used by script developers. If you don't develop scripts or don't know what it is, ignore this file. Description: The file consists of three functions: - "attachHandler" function modifies a function in a way that when it returns a string, specified error handling function is called with that string as argument. It returns modified version of the function. This function should only be used on functions that return a string with error description when an error occurs. There is a list of such functions from GG API in the file. - "defaultHandler" function is an example of error handling function. - "testError" function (commented by default) "simulates" a function that has returned a string with error description, used for testing. How to use: 1. Include contents of the file at the beginning of your code. 2. Optionally create custom error handling functions. Error handling function has to accept 1 argument - a string with error description. 3. Use "attachHandler" function to get modified version of the function and either redefine original function with it or store it in a new variable. 4. Repeat step 3 for all desired functions. Examples: -- Custom error handling function local function myHandler(errorText) gg.toast('Whoops, looks like something went wrong', true) gg.toast('Mysterious error: ' .. errorText) print('Description of the error that has occurred during script execution:\n' .. errorText) end -- Using default error handling function and redefining the original function gg.searchNumber = attachHandler(gg.searchNumber, defaultHandler) -- Using custom error handling function and storing modified function in a new variable local getResultsModified = attachHandler(gg.getResults, myHandler) -- If an error occurs, "defaultHandler" function will be called gg.searchNumber('123', gg.TYPE_DWORD) -- If an error occurs, no error handling function will be called local results1 = gg.getResults(100) -- If an error occurs, "myHandler" function will be called local results2 = getResultsModified(100) Submitter CmP Submitted 01/01/2019 Category Templates  
  2. Version 2.0

    715 downloads

    Note: This file is intended to be used by script developers. If you don't develop scripts or don't know what it is, ignore this file. Description: The file consists of three functions: - "attachHandler" function modifies a function in a way that when it returns a string, specified error handling function is called with that string as argument. It returns modified version of the function. This function should only be used on functions that return a string with error description when an error occurs. There is a list of such functions from GG API in the file. - "defaultHandler" function is an example of error handling function. - "testError" function (commented by default) "simulates" a function that has returned a string with error description, used for testing. How to use: 1. Include contents of the file at the beginning of your code. 2. Optionally create custom error handling functions. Error handling function has to accept 1 argument - a string with error description. 3. Use "attachHandler" function to get modified version of the function and either redefine original function with it or store it in a new variable. 4. Repeat step 3 for all desired functions. Examples: -- Custom error handling function local function myHandler(errorText) gg.toast('Whoops, looks like something went wrong', true) gg.toast('Mysterious error: ' .. errorText) print('Description of the error that has occurred during script execution:\n' .. errorText) end -- Using default error handling function and redefining the original function gg.searchNumber = attachHandler(gg.searchNumber, defaultHandler) -- Using custom error handling function and storing modified function in a new variable local getResultsModified = attachHandler(gg.getResults, myHandler) -- If an error occurs, "defaultHandler" function will be called gg.searchNumber('123', gg.TYPE_DWORD) -- If an error occurs, no error handling function will be called local results1 = gg.getResults(100) -- If an error occurs, "myHandler" function will be called local results2 = getResultsModified(100)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.