Skip to content

Commit 1d5f87e

Browse files
authored
Merge pull request #14 from vunb/dev
fix latest npm does not support nodejs v4, 5
2 parents 7af2510 + 3ee8548 commit 1d5f87e

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ install:
2323
# install submodules
2424
- git submodule update --init
2525
# fixes nodejs/node-gyp#972
26-
- npm install -g npm@latest
26+
- npm install -g npm@5.7.1
2727
# install modules
2828
- npm install -g node-pre-gyp node-pre-gyp-github
2929
- npm install --build-from-source

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fasttext",
3-
"version": "0.2.2",
3+
"version": "0.2.3",
44
"description": "A nodejs binding for fasttext representation and classification",
55
"main": "index.js",
66
"scripts": {

src/nnWorker.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22

3+
#include <iostream>
34
#include "nnWorker.h"
45
#include <v8.h>
56

@@ -9,7 +10,14 @@ void NnWorker::Execute () {
910
wrapper_->precomputeWordVectors();
1011
result_ = wrapper_->nn(query_, k_);
1112
} catch (std::string errorMessage) {
13+
std::cout << "Exception: " << errorMessage << std::endl;
1214
SetErrorMessage(errorMessage.c_str());
15+
} catch (const char * str) {
16+
std::cout << "Exception: " << str << std::endl;
17+
SetErrorMessage(str);
18+
} catch(const std::exception& e) {
19+
std::cout << "Exception: " << e.what() << std::endl;
20+
SetErrorMessage(e.what());
1321
}
1422
}
1523

0 commit comments

Comments
 (0)