webknossos icon indicating copy to clipboard operation
webknossos copied to clipboard

Raw SQL Error on NML Upload with duplicate layer names

Open fm3 opened this issue 1 year ago • 0 comments

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)

fm3 avatar Apr 29 '24 09:04 fm3