webknossos
webknossos copied to clipboard
Raw SQL Error on NML Upload with duplicate layer names
When uploading an annotation zipfile that has duplicate volume layer names in the NML, a raw SQL error is thrown. We should add a scala-side assertion to ensure a readable error message.
[WARN] controllers.AnnotationIOController - Answering 400 at /api/annotations/upload for user xxx: {"messages":[{"error":"SQL Failure: ERROR: duplicate key value violates unique constraint "annotation_layers_name__annotation_key"\n Detail: Key (name, _annotation)=(myLayerName, myAnnotationId) already exists."}]} at models.annotation.AnnotationDAO.insertOne(Annotation.scala:589)