add PromptTemplateError. KeyError leads to some particularly confusing error messages that are whatever text happened to be in, frequently, JSON sent in the prompt template
clean the PromptTooLong error message, which contains an irrelevant traceback, and just use a regex to extract the relevant information