File tree Expand file tree Collapse file tree 4 files changed +22
-23
lines changed
Expand file tree Collapse file tree 4 files changed +22
-23
lines changed Original file line number Diff line number Diff line change 11671167 $scope . vm . error = { buffer : 'RAML origin check failed. Raml does not reside underneath the path:' + RAML . LoaderUtils . allowedRamlOrigin ( $scope . options ) } ;
11681168 } else {
11691169 return ramlParser . loadPath ( $window . resolveUrl ( url ) , null , $scope . options )
1170- . then ( function ( raml ) {
1171- $scope . vm . raml = raml ;
1170+ . then ( function ( api ) {
1171+ $scope . vm . raml = api . specification ;
11721172 } )
11731173 . catch ( function ( error ) {
11741174 $scope . vm . error = angular . extend ( error , {
16711671
16721672 return promise
16731673 . then ( function ( api ) {
1674- $scope . vm . raml = api . specification ;
1675- } )
1676- . catch ( function ( error ) {
1677- $scope . vm . error = error ;
1678- $scope . vm . codeMirror . lint = lintFromError ( error . parseErrors ) ;
1674+ if ( api . errors . length <= 0 ) {
1675+ $scope . vm . raml = api . specification ;
1676+ } else {
1677+ $scope . vm . error = { message : 'Api contains errors.' } ;
1678+ $scope . vm . codeMirror . lint = lintFromError ( api . errors ) ;
1679+ }
16791680 } )
16801681 . finally ( function ( ) {
16811682 $scope . vm . isLoading = false ;
29572958 options = options || { } ;
29582959 return RAML . Parser . loadApi ( path , {
29592960 attributeDefaults : true ,
2960- rejectOnErrors : true ,
2961+ rejectOnErrors : false ,
29612962 fsResolver : {
29622963 contentAsync : contentAsyncFn ,
29632964 content : content
Original file line number Diff line number Diff line change 4444 $scope . vm . error = { buffer : 'RAML origin check failed. Raml does not reside underneath the path:' + RAML . LoaderUtils . allowedRamlOrigin ( $scope . options ) } ;
4545 } else {
4646 return ramlParser . loadPath ( $window . resolveUrl ( url ) , null , $scope . options )
47- . then ( function ( raml ) {
48- $scope . vm . raml = raml ;
49- } )
50- . catch ( function ( error ) {
51- $scope . vm . error = angular . extend ( error , {
52- /*jshint camelcase: false */
53- buffer : ( error . context_mark || error . problem_mark ) . buffer
54- /*jshint camelcase: true */
55- } ) ;
47+ . then ( function ( api ) {
48+ if ( api . errors . length <= 0 ) {
49+ $scope . vm . raml = api . specification ;
50+ } else {
51+ $scope . vm . error = { message : 'Api contains errors.' } ;
52+ }
5653 } )
5754 . finally ( function ( ) {
5855 $scope . vm . loaded = true ;
Original file line number Diff line number Diff line change 7777
7878 return promise
7979 . then ( function ( api ) {
80- $scope . vm . raml = api . specification ;
81- } )
82- . catch ( function ( error ) {
83- $scope . vm . error = error ;
84- $scope . vm . codeMirror . lint = lintFromError ( error . parseErrors ) ;
80+ if ( api . errors . length <= 0 ) {
81+ $scope . vm . raml = api . specification ;
82+ } else {
83+ $scope . vm . error = { message : 'Api contains errors.' } ;
84+ $scope . vm . codeMirror . lint = lintFromError ( api . errors ) ;
85+ }
8586 } )
8687 . finally ( function ( ) {
8788 $scope . vm . isLoading = false ;
Original file line number Diff line number Diff line change 5252 options = options || { } ;
5353 return RAML . Parser . loadApi ( path , {
5454 attributeDefaults : true ,
55- rejectOnErrors : true ,
55+ rejectOnErrors : false ,
5656 fsResolver : {
5757 contentAsync : contentAsyncFn ,
5858 content : content
You can’t perform that action at this time.
0 commit comments