I've fixed the specific issue with spaces with this commit: bc2b9ea4
However, I'm going to edit this issue into a more general one about displaying the errors nicely, since plenty of other things will still produce the same ugly error, like trying to use a hyphen in the tag.
Deimoschanged title from A space in the tag query parameter results in an ugly error page to Invalid characters in the tag query parameter results in an ugly error page
changed title from A space in the tag query parameter results in an ugly error page to Invalid characters in the tag query parameter results in an ugly error page
Deimoschanged title from Invalid characters in the tag query parameter results in an ugly error page to Invalid characters in the tag query parameter results in an uninformative error page
changed title from Invalid characters in the tag query parameter results in an ugly error page to Invalid characters in the tag query parameter results in an uninformative error page