function Promise.prototype.andThen(z,Z,w)assert(Z==nil or isCallable(Z),string.format(ERROR_NON_FUNCTION,"\080\114\111\109\105\115\101\058\097\110\100\084\104\101\110"))assert(w==nil or isCallable(w),string.format(ERROR_NON_FUNCTION,"\080\114\111\109\105\115\101\058\097\110\100\084\104\101\110"))return z:_andThen(debug.traceback(nil,2),Z,w)end
--[=[
	Chains onto an existing Promise and returns a new Promise.

	:::warning
	Within the failure handler, you should never assume that the rejection value is a string. Some rejections within the Promise library are represented by [[Error]] objects. If you want to treat it as a string for debugging, you should call `tostring` on it first.
	:::

	Return a Promise from the success or failure handler and it will be chained onto.

	@param successHandler (...: any) -> ...any
	@param failureHandler? (...: any) -> ...any
	@return Promise<...any>
]=]
function Promise.prototype:andThen(successHandler, failureHandler)
	assert(successHandler == nil or isCallable(successHandler), string.format(ERROR_NON_FUNCTION, "Promise:andThen"))
	assert(failureHandler == nil or isCallable(failureHandler), string.format(ERROR_NON_FUNCTION, "Promise:andThen"))

	return self:_andThen(debug.traceback(nil, 2), successHandler, failureHandler)
end
