Permalink
Browse files

Browser errors

  • Loading branch information...
1 parent 7d4f3a3 commit 051da20d34e01beb5296f970e326b5475a18154e @hueniverse committed Jul 15, 2013
Showing with 7 additions and 3 deletions.
  1. +3 −1 lib/browser.js
  2. +3 −1 lib/client.js
  3. +1 −1 lib/index.js
View
@@ -60,6 +60,7 @@ hawk.client = {
!method || typeof method !== 'string' ||
!options || typeof options !== 'object') {
+ result.err = 'Invalid argument type';
return result;
}
@@ -75,11 +76,12 @@ hawk.client = {
!credentials.key ||
!credentials.algorithm) {
- // Invalid credential object
+ result.err = 'Invalid credential object';
return result;
}
if (hawk.crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+ result.err = 'Unknown algorithm';
return result;
}
View
@@ -54,6 +54,7 @@ exports.header = function (uri, method, options) {
!method || typeof method !== 'string' ||
!options || typeof options !== 'object') {
+ result.err = 'Invalid argument type';
return result;
}
@@ -69,11 +70,12 @@ exports.header = function (uri, method, options) {
!credentials.key ||
!credentials.algorithm) {
- // Invalid credential object
+ result.err = 'Invalid credential object';
return result;
}
if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+ result.err = 'Unknown algorithm';
return result;
}
View
@@ -2,6 +2,7 @@
exports.error = exports.Error = require('boom');
exports.sntp = require('sntp');
+
exports.server = require('./server');
exports.client = require('./client');
exports.crypto = require('./crypto');
@@ -12,4 +13,3 @@ exports.uri = {
getBewit: exports.client.getBewit
};
-

0 comments on commit 051da20

Please sign in to comment.