calcom/cal.diy · critical · InternalServerErrorException
Could not find public event.
Error message
Could not find public event.
What it means
Thrown by EventTypesController_2024_04_15.getPublicEventType as InternalServerErrorException (HTTP 500) when the catch block completes without throwing — i.e. the caught value is not an Error instance. Because the catch only handles Error subclasses, a non-Error throw (string, plain object) falls through and execution reaches the trailing `throw new InternalServerErrorException`.
Source
Thrown at apps/api/v2/src/platform/event-types/event-types_2024_04_15/controllers/event-types.controller.ts:157
eventSlug,
queryParams.isTeamEvent,
orgSlug ?? null,
this.prismaReadService.prisma as unknown as PrismaClient,
// We should be fine allowing unpublished orgs events to be servable through platform because Platform access is behind license
// If there is ever a need to restrict this, we can introduce a new query param `fromRedirectOfNonOrgLink`
true
);
return {
data: event as unknown as PublicEventTypeOutput,
status: SUCCESS_STATUS,
};
} catch (err) {
if (err instanceof Error) {
throw new NotFoundException(err.message);
}
}
throw new InternalServerErrorException("Could not find public event.");
}
@Get("/:username/public")
async getPublicEventTypes(@Param("username") username: string): Promise<GetEventTypesPublicOutput> {
const eventTypes = await this.eventTypesService.getEventTypesPublicByUsername(username);
return {
status: SUCCESS_STATUS,
data: eventTypes,
};
}
@Patch("/:eventTypeId")
@Permissions([EVENT_TYPE_WRITE])
@UseGuards(ApiAuthGuard)
@HttpCode(HttpStatus.OK)
async updateEventType(
@Param() params: EventTypeIdParams_2024_04_15,View on GitHub (pinned to 176037d0af)
Solutions
- Retry the request once to rule out a transient cause; if it persists, escalate to server logs.
- Search getPublicEvent and its callees for `throw` of non-Error values and normalize them to Error.
- Add a default branch in the catch that logs the raw value (typeof + JSON) before falling through.
- If you control the server, refactor the catch to handle unknown values explicitly instead of relying on the fallthrough.
Example fix
// before
} catch (err) {
if (err instanceof Error) throw new NotFoundException(err.message);
}
throw new InternalServerErrorException('Could not find public event.');
// after
} catch (err) {
if (err instanceof HttpException) throw err;
if (err instanceof Error) throw new NotFoundException(err.message);
logger.error({ err }, 'Non-Error thrown in getPublicEventType');
}
throw new InternalServerErrorException('Could not find public event.'); Defensive patterns
Strategy: retry
Try / catch
try {
return await api.get(`/v2/event-types/${username}/${slug}/public`);
} catch (e) {
if (e.response?.status === 500) {
// retry once; if it persists, the server caught a non-Error — escalate
return await api.get(`/v2/event-types/${username}/${slug}/public`);
}
throw e;
} Prevention
- Escalate persistent 500s to the server team — the catch fallthrough is a defect.
- In your own code, never throw non-Error values; always use `throw new Error(...)`.
- Add server-side logging that captures typeof + value of any caught non-Error.
When it happens
Trigger: getPublicEvent (or its dependencies: organizationsRepository.findTeamIdAndSlugFromClientId, the Prisma read service) throwing a non-Error value; a Promise rejection with a primitive; an unhandled edge case in team/org resolution that rejects with a plain object.
Common situations: A library used by getPublicEvent throwing a string error; a stale build where a dependency was partially upgraded; a mocked test that rejects with a non-Error. This is a server defect, not a client-correctable condition.
Related errors
- error?.message ?? errMsg
- errMsg
- Failed to update private link
- Failed to delete private link
- ${err.message}
AI-assisted analysis of calcom/cal.diy@176037d0af (2026-08-12).
Data as JSON: /api/errors/e86d990c3e4e4d4d.
Report an issue: GitHub.