Closed meowtec closed 9 years ago
Hi @meowtec, welcome to Ghost =) I'm not sure if you're reporting a bug you've run into, or if you're just commenting on the code. If it's the former, could you give us some more specifics per the bug reporting guidelines? And if it's the latter, the line above the indexOf
check makes sure that err is a string (unless err.message
isn't a string, I suppose...), and so indexOf
is defined.
I'm just going to close this for now to keep things cleaned up, I'll be happy to reopen it if you can provide the bug report details
Hi @novaugust,
I am using a ghost copy forked from TryGhost/Ghost
. In this copy, the mender replace the local file storage to a cloud storage called qiniu
.
And he use a SDK provided by qiniu cloud storage, The SDK will throw an error if something wrong happen. On the error object, property message
is undefined
.
so ERROR: Cannot call method 'indexOf' of undefined
happend..
I am not good at English, so I wish you will understande what I mean.
if another module which Ghost dependences throw an err (isObject) without message property,here will be a new error ERROR: Cannot call method 'indexOf' of undefined
.
Hi @meowtec ,
I see the problem that you're talking about and there is definitely a case in which an error could be produced. If you're interested in fixing it we'd happily take a pull request on it, otherwise I can just re-open this issue so we're aware of it and it'll get fixed down the road.
file: core/server/errors/index.js Line: 110
If
err
is like this:then an new error
ERROR: Cannot call method 'indexOf' of undefined
will be thrown.