gabrielcsapo / gabrielcsapo/node-git-server

How reject works?

未关闭
#110 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
262
派生
81
PR 合并指标
30 天内没有已合并 PR

描述

Lets say I listen to some push event and for some reason I decide to reject this push. I tried to do something like:

```
repos.on("push", (data: PushData) => {
data.reject(403, `Rejected! Have a good day`)
});
```

It really returns some error to the client, But it doesn't return the specific message I chose (It does send the correct code)

What am I doing wrong?

贡献指南

这个仓库没有索引到贡献指南

调研方向

从 issue 中的 repos.on("push") 处理程序和 data.reject(403, ...) 示例开始,然后使用所示 snippet 重现响应。跟踪 rejection 如何到达客户端,并验证返回的是所选消息以及状态码 403。

由索引模型根据 Issue 内容生成。

评估

技术栈
git, node.js, typescript
领域
backend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
30/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。