Skip to content

Commit

Permalink
Merge pull request #14 from vunb/dev
Browse files Browse the repository at this point in the history
 fix latest npm does not support nodejs v4, 5
  • Loading branch information
vunb committed May 14, 2018
2 parents 7af2510 + 3ee8548 commit 1d5f87e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Expand Up @@ -23,7 +23,7 @@ install:
# install submodules
- git submodule update --init
# fixes nodejs/node-gyp#972
- npm install -g npm@latest
- npm install -g npm@5.7.1
# install modules
- npm install -g node-pre-gyp node-pre-gyp-github
- npm install --build-from-source
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "fasttext",
"version": "0.2.2",
"version": "0.2.3",
"description": "A nodejs binding for fasttext representation and classification",
"main": "index.js",
"scripts": {
Expand Down
8 changes: 8 additions & 0 deletions src/nnWorker.cc
@@ -1,5 +1,6 @@


#include <iostream>
#include "nnWorker.h"
#include <v8.h>

Expand All @@ -9,7 +10,14 @@ void NnWorker::Execute () {
wrapper_->precomputeWordVectors();
result_ = wrapper_->nn(query_, k_);
} catch (std::string errorMessage) {
std::cout << "Exception: " << errorMessage << std::endl;
SetErrorMessage(errorMessage.c_str());
} catch (const char * str) {
std::cout << "Exception: " << str << std::endl;
SetErrorMessage(str);
} catch(const std::exception& e) {
std::cout << "Exception: " << e.what() << std::endl;
SetErrorMessage(e.what());
}
}

Expand Down

0 comments on commit 1d5f87e

Please sign in to comment.