This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import discord | |
import asyncio | |
client = discord.Client() | |
@client.event | |
async def on_ready(): | |
print('Logged in as') | |
print(client.user.name) | |
print(client.user.id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function thisMightFail(callback, errback) { | |
xhrGet('/result', callback, errback); | |
} | |
function recoverFromFailure(callback, errback) { | |
recoverAsync( | |
function(result) { | |
if(callback) { | |
try { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function thisMightFail() { | |
//... | |
if(badThingsHappened) { | |
throw new Error(...); | |
} | |
return theGoodResult; | |
} | |
function recoverFromFailure(e) { |