diff --git a/src/scheduler.c b/src/scheduler.c
index 0d96368e5711935813322107df4286176210552a..a0d44cfecf1b7044b2875495d83a8acc35b03ba8 100644
--- a/src/scheduler.c
+++ b/src/scheduler.c
@@ -996,9 +996,10 @@ void scheduler_set_unlocks(struct scheduler *s) {
 #ifdef SWIFT_DEBUG_CHECKS
     /* Check that we are not overflowing */
     if (counts[s->unlock_ind[k]] < 0)
-      error("Task unlocking more than %d other tasks!",
-            (1 << (8 * sizeof(short int) - 1)) - 1);
-
+      error("Task (type=%s/%s) unlocking more than %d other tasks!",
+	    taskID_names[s->tasks[s->unlock_ind[k]].type],
+	    subtaskID_names[s->tasks[s->unlock_ind[k]].subtype],
+	    (1 << (8 * sizeof(short int) - 1)) - 1);
 #endif
   }