Per the RFC, each part of a FQDN must not have a length that goes over 63 octets (usually means 63 characters).
This means a Netlify user must not deploy from a branch whose name length is over 56 characters: https://answers.netlify.com/t/branch-deploy-failing-to-use-branchname-for-url/12396/2
A user had this issue. We could add a check in the plugin for the length of each part of the deployPrimeUrl to avoid getting a 500.
Also we could do it on the backend and return an explicit error.