diff options
author | Trevor Elliott <trevor@galois.com> | 2013-06-07 16:42:11 -0700 |
---|---|---|
committer | Trevor Elliott <trevor@galois.com> | 2013-06-07 16:48:17 -0700 |
commit | 8b5d3c6b75744cf5938f253d20f367999e92b1a7 (patch) | |
tree | b516a82c5b198fd080d265e56b3edf19d1180f10 /tools/addon-sdk-1.5/packages/api-utils/docs/errors.md | |
parent | f37588f9a4c7c6b418c64f03d82d48ecd14da217 (diff) |
Remove the addon-sdk from the repo, and download it on demand
Diffstat (limited to 'tools/addon-sdk-1.5/packages/api-utils/docs/errors.md')
-rw-r--r-- | tools/addon-sdk-1.5/packages/api-utils/docs/errors.md | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/tools/addon-sdk-1.5/packages/api-utils/docs/errors.md b/tools/addon-sdk-1.5/packages/api-utils/docs/errors.md deleted file mode 100644 index 98e94ac..0000000 --- a/tools/addon-sdk-1.5/packages/api-utils/docs/errors.md +++ /dev/null @@ -1,42 +0,0 @@ -<!-- This Source Code Form is subject to the terms of the Mozilla Public - - License, v. 2.0. If a copy of the MPL was not distributed with this - - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> - -<!-- contributed by Drew Willcoxon [adw@mozilla.com] --> - -The `errors` module provides helpers for safely invoking user callbacks. - -<api name="catchAndLog"> -@function - Wraps a callback in a function that when invoked will catch and log any - exception thrown by the callback. -@param callback {function} - The callback to wrap. -@param [defaultResponse] {value} - This value will be returned by the wrapper if `callback` throws an exception. - If not given, `undefined` is used. -@param [logException] {function} - When `callback` throws an exception, it will be passed to this function. If - not given, the exception is logged using `console.exception()`. -@returns {function} - A function that will invoke `callback` when called. The return value of this - function is the return value of `callback` unless `callback` throws an - exception. In that case, `defaultResponse` is returned or `undefined` if - `defaultResponse` is not given. -</api> - -<api name="catchAndLogProps"> -@function - Replaces methods of an object with wrapped versions of those methods returned - by `catchAndLog()`. -@param object {object} - The object whose methods to replace. -@param props {string,array} - The names of the methods of `object` to replace, either a string for a single - method or an array of strings for multiple methods. -@param [defaultResponse] {value} - This value will be returned by any wrapper whose wrapped method throws an - exception. If not given, `undefined` is used. -@param [logException] {function} - See `catchAndLog()`. -</api> |