Skip to content

Commit

Permalink
Commit before pushing it to GITHUB
Browse files Browse the repository at this point in the history
Signed-off-by: Rishabh Mahajan <rishabhmhjn@gmail.com>
  • Loading branch information
rishabhmhjn committed Nov 14, 2012
1 parent 0144f26 commit 405379c
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,34 @@
* @author rishabhmhjn
*/

var solrClient = module.exports = function() {
/**
* @param message
* @param options
* @returns {SolrClientException}
*/
function SolrClientException(message, options) {
this.message = message;
this.options = options;
this.name = "SolrClientException";
}

var solrClient = module.exports = function(options) {
var defaultSolrClient = {
host : '127.0.0.1',
port : '8983',
core : '',
path : '/solr'
};

if (typeof options != 'undefined') {
if (typeof options.host == "undefined"
|| typeof options.port == "undefined"
|| typeof options.path == "undefined") {
throw new SolrClientException("Bad Client Details", options);
} else {
this.client = options;
}
} else {
this.client = defaultSolrClient;
}
};

0 comments on commit 405379c

Please sign in to comment.