This repository was archived by the owner on Aug 22, 2023. It is now read-only.
  
  
  
  
Improve UniqueNodeError for usability #68
                
     Merged
            
            
          
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
A common situation for my developing with the SDK that, I don't know if a node exists or not.
For example, a script that adds a Material to a collection, might create the collection first, but with the second material that the
Collectionnode exists already.Or citing a paper, a different user might have added the reference already.
For these situations it would be nice to catch the exception and fetch the existing node instead.
(Or course, this has to be used with a bit of care to not overwrite or use false duplicate nodes.)
So this would be ideal:
This requires that the
UniqueNodeErrortransparently makes the found url accessible.In this PR, I simply parse the URL from the message and make it available.
As a precaution for changing message, I issue warnings if no such URL can be found.