We can search for hybrid species by searching on the cross symbol (×) with the query https://www.betydb.org/api/beta/species?key=&scientificname=~%C3%97. But suppose the user mistakenly writes %3C%97 instead of %C3%97 for the URL encoding of the cross symbol. The query then becomes https://www.betydb.org/api/beta/species?key=&scientificname=~%3C%97. This query will respond with the (HTML) "We're sorry, but something went wrong" page on account of an exception triggered by the encoding error (PG::CharacterNotInRepertoire: ERROR: invalid byte sequence for encoding "UTF8").
The response should be in JSON format and should give clear information as to the nature of the error. (Similarly when requesting results in XML format.)
We can search for hybrid species by searching on the cross symbol (×) with the query https://www.betydb.org/api/beta/species?key=&scientificname=~%C3%97. But suppose the user mistakenly writes %3C%97 instead of %C3%97 for the URL encoding of the cross symbol. The query then becomes https://www.betydb.org/api/beta/species?key=&scientificname=~%3C%97. This query will respond with the (HTML) "We're sorry, but something went wrong" page on account of an exception triggered by the encoding error (PG::CharacterNotInRepertoire: ERROR: invalid byte sequence for encoding "UTF8").
The response should be in JSON format and should give clear information as to the nature of the error. (Similarly when requesting results in XML format.)