Browse Source

raise ValueError instead of string

saleml 2 years ago
parent
commit
4da711a317
1 changed files with 2 additions and 1 deletions
  1. 2 1
      gym_minigrid/roomgrid.py

+ 2 - 1
gym_minigrid/roomgrid.py

@@ -208,7 +208,8 @@ class RoomGrid(MiniGridEnv):
         elif kind == "box":
             obj = Box(color)
         else:
-            raise f"{kind} object kind is not available in this environment."
+            raise ValueError(
+                f"{kind} object kind is not available in this environment.")
 
         return self.place_in_room(i, j, obj)