diff --git a/lib/openapi3_parser/node_factory.rb b/lib/openapi3_parser/node_factory.rb
index <HASH>..<HASH> 100644
--- a/lib/openapi3_parser/node_factory.rb
+++ b/lib/openapi3_parser/node_factory.rb
@@ -111,8 +111,8 @@ module Openapi3Parser
       end
 
       unless valid_type?
-        raise Openapi3Parser::Error,
-              "Invalid type for #{context.stringify_namespace}. "\
+        raise Openapi3Parser::Error::InvalidType,
+              "Invalid type for #{context.location_summary}. "\
               "#{validate_type}"
       end
Use InvalidType error and location_summary in NodeFactory