 						case "getColors":
 							try sendColors(json: json, user: user!)
 						case "getTileData": break
-						default: break
+						default:
+							throw BackendError.invalidRequestType
 						}
 					} catch {
-						sendError(error: error, socket: webSocket)
+						sendError(error: error as! BackendError, socket: webSocket)
 					}
 				}
 			}


enum BackendError: Error {
	case invalidUserID
	case noUserID
	case userIPBanned
	case parameterMissingX

				errorMessage = "Invalid color ID provided"
			case .parameterMissingColorID:
				errorMessage = "Missing color ID parameter"
			case .invalidRequestType:
				errorMessage = "Invalid requestType provided"
			}
			var structure = [[String: NodeRepresentable]]()
			structure.append(["responseType": "error",
