-
Notifications
You must be signed in to change notification settings - Fork 30
feat: support Hapi17 #89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support Hapi17 #89
Conversation
if (isObject(config)) { | ||
service = config.getServiceContext().service; | ||
version = config.getServiceContext().version; | ||
service = config!.getServiceContext().service; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/interfaces/hapi.ts
Outdated
(server as hapi.Server).on('request-error', (req, err) => { | ||
client.sendError(hapiErrorHandler(req, err, config)); | ||
if (server) { | ||
if ((server as any).events && (server as any).events.on) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/interfaces/hapi.ts
Outdated
request, | ||
if (isFunction((server as hapi.Server).ext)) { | ||
(server as hapi.Server).ext('onPreResponse', (request, reply) => { | ||
if (isObject(request) && isObject(request.response) && |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
const returnObject = new RequestInformationContainer(); | ||
|
||
if (!isObject(req) || !isObject(req.headers) || isFunction(req) || | ||
if (!isObject(req) || !isObject(req!.headers) || isFunction(req) || |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/interfaces/hapi.ts
Outdated
(server as hapi.Server).on('request-error', (req, err) => { | ||
client.sendError(hapiErrorHandler(req, err, config)); | ||
if (server) { | ||
if ((server as any).events && (server as any).events.on) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/interfaces/hapi.ts
Outdated
* ErrorMessage | ||
*/ | ||
function hapiErrorHandler(req: hapi.Request, err: {}, config: Configuration) { | ||
function hapiErrorHandler(req: hapi.Request|undefined, err: {}, config?: Configuration) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
1298af6
to
a8f355d
Compare
d9c838f
to
dba6935
Compare
dba6935
to
2152a4b
Compare
An error should only be recorded if its channel is 'error'.
event: () => ErrorMessage; | ||
hapi: {register: (server: {}, options: {}, next: Function) => void}; | ||
hapi: { | ||
register: (server: {}, options: {}, next?: Function) => void; name: string; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
test/unit/interfaces/hapi.ts
Outdated
errorsSent.length = 0; | ||
}); | ||
|
||
it(`Plugin should have name and version properties`, () => { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
No description provided.