Skip to content
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

fix(logging): change error to warn #801

Merged
merged 3 commits into from
Jan 14, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class Webhooks<TTransformed = unknown> {
this.sign = sign.bind(null, options.secret);
this.verify = (eventPayload: object | string, signature: string) => {
if (typeof eventPayload === "object") {
console.error(
console.warn(
"[@octokit/webhooks] Passing a JSON payload object to `verify()` is deprecated and the functionality will be removed in a future release of `@octokit/webhooks`"
);
}
Expand All @@ -79,7 +79,7 @@ class Webhooks<TTransformed = unknown> {
| EmitterWebhookEventWithSignature
) => {
if (typeof options.payload === "object") {
console.error(
console.warn(
"[@octokit/webhooks] Passing a JSON payload object to `verifyAndReceive()` is deprecated and the functionality will be removed in a future release of `@octokit/webhooks`"
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/middleware/node/get-payload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function getPayload(

if (request.body) {
if (typeof request.body !== "string") {
console.error(
console.warn(
"[@octokit/webhooks] Passing the payload as a JSON object in `request.body` is deprecated and will be removed in a future release of `@octokit/webhooks`, please pass it as a a `string` instead."
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/middleware/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function createNodeMiddleware(
}: MiddlewareOptions = {}
) {
const deprecateOnUnhandledRequest = (request: any, response: any) => {
console.error(
console.warn(
"[@octokit/webhooks] `onUnhandledRequest()` is deprecated and will be removed in a future release of `@octokit/webhooks`"
);
return onUnhandledRequest(request, response);
Expand Down