Extracts the passcode for a specific channel from the query parameters.
If the channel is present but no passcode is provided, it sets an error message.
Parameters
channel: string
The channel to check for (e.g., "moderator", "participant").
query: ParsedUrlQuery
The parsed URL query parameters.
setErrorMessage: (err:string)=>void
Function to set an error message if needed.
Returns string|null
The passcode for the specified channel, or null if not found or error.
Extracts the passcode for a specific channel from the query parameters. If the channel is present but no passcode is provided, it sets an error message.