| 
									
										
										
										
											2025-06-27 17:54:04 -07:00
										 |  |  | export function not_found(): Response { | 
					
						
							|  |  |  | 	if (Deno.env.get('TRACE_ERROR_RESPONSES')) { | 
					
						
							|  |  |  | 		console.trace('not_found'); | 
					
						
							| 
									
										
										
										
											2025-06-25 20:51:29 -07:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2025-06-27 17:54:04 -07:00
										 |  |  | 	return Response.json({ | 
					
						
							|  |  |  | 		error: { | 
					
						
							|  |  |  | 			message: 'Not found.', | 
					
						
							|  |  |  | 			cause: 'not_found' | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	}, { | 
					
						
							|  |  |  | 		status: 404 | 
					
						
							|  |  |  | 	}); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export function permission_denied(): Response { | 
					
						
							|  |  |  | 	if (Deno.env.get('TRACE_ERROR_RESPONSES')) { | 
					
						
							|  |  |  | 		console.trace('permission_denied'); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	return Response.json({ | 
					
						
							|  |  |  | 		error: { | 
					
						
							|  |  |  | 			message: 'Permission denied.', | 
					
						
							|  |  |  | 			cause: 'permission_denied' | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	}, { | 
					
						
							|  |  |  | 		status: 400 | 
					
						
							|  |  |  | 	}); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export function append_only_events(): Response { | 
					
						
							|  |  |  | 	if (Deno.env.get('TRACE_ERROR_RESPONSES')) { | 
					
						
							|  |  |  | 		console.trace('append_only_events'); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	return Response.json({ | 
					
						
							|  |  |  | 		error: { | 
					
						
							|  |  |  | 			message: 'This server does not allow modifying events.', | 
					
						
							|  |  |  | 			cause: 'append_only_events' | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	}, { | 
					
						
							|  |  |  | 		status: 400 | 
					
						
							|  |  |  | 	}); | 
					
						
							|  |  |  | } |