Skip to content

Commit 94178df

Browse files
michaelhelveyflovilmart
authored andcommitted
Add functionName to invalid function error (#2963)
Currently in the logs if an invalid function is called the error message just says "invalid function" which is decidedly unhelpful when looking through server logs. Now it will say "Invalid function: "functionName""
1 parent 4a2f7ff commit 94178df

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

spec/ParseAPI.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ it('ensure that if you try to sign up a user with a unique username and email, b
11291129
done();
11301130
}, (e) => {
11311131
expect(e.code).toEqual(Parse.Error.SCRIPT_FAILED);
1132-
expect(e.message).toEqual('Invalid function.');
1132+
expect(e.message).toEqual('Invalid function: "somethingThatDoesDefinitelyNotExist"');
11331133
done();
11341134
});
11351135
});

src/Routers/FunctionsRouter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export class FunctionsRouter extends PromiseRouter {
161161
theFunction(request, response);
162162
});
163163
} else {
164-
throw new Parse.Error(Parse.Error.SCRIPT_FAILED, 'Invalid function.');
164+
throw new Parse.Error(Parse.Error.SCRIPT_FAILED, `Invalid function: "${functionName}"`);
165165
}
166166
}
167167
}

0 commit comments

Comments
 (0)