more use of identifiable errors, improvements to inner error rendering, and more heuristics for is-retryable-error
This commit is contained in:
parent
c8797451e3
commit
2cba0ada3c
33 changed files with 241 additions and 157 deletions
|
|
@ -68,11 +68,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
private readonly moderationLogService: ModerationLogService,
|
||||
) {
|
||||
super(meta, paramDef, async (ps, me) => {
|
||||
try {
|
||||
if (new URL(ps.inbox).protocol !== 'https:') throw new Error('https only');
|
||||
} catch {
|
||||
throw new ApiError(meta.errors.invalidUrl);
|
||||
}
|
||||
if (!URL.canParse(ps.inbox)) throw new ApiError(meta.errors.invalidUrl);
|
||||
if (new URL(ps.inbox).protocol !== 'https:') throw new ApiError(meta.errors.invalidUrl);
|
||||
|
||||
await this.moderationLogService.log(me, 'addRelay', {
|
||||
inbox: ps.inbox,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue