import Vapor
import Validation

public struct JSONValidator: Validator {

    public func validate(_ input: String) throws {
        do {
            _ = try JSON(bytes: input.makeBytes())
        } catch {
            throw self.error("Invalid JSON.")
        }
    }
}

import Vapor
import Validation

public struct JSONValidator: Validator {

    public func validate(_ input: String) throws {
        do {
            _ = try JSON(bytes: input.makeBytes())
        } catch {
            throw Validator.error("Invalid JSON.")
        }
    }
}

--- 
+++ 
@@ -7,7 +7,7 @@
         do {
             _ = try JSON(bytes: input.makeBytes())
         } catch {
-            throw Validator.error("Invalid JSON.")
+            throw self.error("Invalid JSON.")
         }
     }
 }
Throw error correctly (for real this time)
