mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 04:23:31 +01:00
fix: don't throw on not serializable kind
This commit is contained in:
@@ -152,7 +152,8 @@ export interface ApiConstructorJSON extends ApiItemJSON, ApiParameterListJSON {
|
|||||||
export class ApiNodeJSONEncoder {
|
export class ApiNodeJSONEncoder {
|
||||||
public static encode(model: ApiModel, node: ApiItem, version: string) {
|
public static encode(model: ApiModel, node: ApiItem, version: string) {
|
||||||
if (!(node instanceof ApiDeclaredItem)) {
|
if (!(node instanceof ApiDeclaredItem)) {
|
||||||
throw new Error(`Cannot serialize node of type ${node.kind}`);
|
console.log(`Cannot serialize node of type ${node.kind}`);
|
||||||
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (node.kind) {
|
switch (node.kind) {
|
||||||
@@ -169,7 +170,8 @@ export class ApiNodeJSONEncoder {
|
|||||||
case ApiItemKind.Variable:
|
case ApiItemKind.Variable:
|
||||||
return this.encodeVariable(model, node as ApiVariable, version);
|
return this.encodeVariable(model, node as ApiVariable, version);
|
||||||
default:
|
default:
|
||||||
throw new Error(`Unknown API item kind: ${node.kind}`);
|
console.log(`Unknown API item kind: ${node.kind}`);
|
||||||
|
return undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user