Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Commit

Permalink
Browser errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Eran Hammer committed Jul 15, 2013
1 parent 7d4f3a3 commit 051da20
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ hawk.client = {
!method || typeof method !== 'string' ||
!options || typeof options !== 'object') {

result.err = 'Invalid argument type';
return result;
}

Expand All @@ -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;
}

Expand Down
4 changes: 3 additions & 1 deletion lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -12,4 +13,3 @@ exports.uri = {
getBewit: exports.client.getBewit
};


0 comments on commit 051da20

Please sign in to comment.