Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

PlasticSCM hijacking and hiding errors

Discussion in 'Unity Version Control' started by Spellbook, Dec 22, 2021.

  1. Spellbook

    Spellbook

    Joined:
    May 21, 2015
    Posts:
    29
    After a fresh from-scratch Unity Hub and Unity 2021.2.7f1 install we've discovered "PlasticSCM" also came with it (apparently?). Have never heard of this component and did not opt-in for it.

    It is hijacking and silently eating unhandled errors intended for the console. This wasted a significant amount of time and development energy.

    Specifically, in PlasticApp.cs "HandleUnhandledException" is consuming exceptions, deciding that "IsPlasticStackTrace" is false, so it just exits quietly, causing exception logging that previously defaulted to the console to disappear. This is some nasty misbehavior.

    Why is this being done, and why is it the default for a fresh Unity install? A new or non-technical user is not going to be able to figure this out.
     
    Last edited: Dec 22, 2021
  2. Ryan-Unity

    Ryan-Unity

    Unity Technologies

    Joined:
    Mar 23, 2016
    Posts:
    1,993
    Hi @Spellbook, I'm sorry that you're experiencing this issue. I've tried to reproduce it on my end but was still able to see specific exceptions thrown from my code while the Version Control package (where the PlasticApp.cs script you pointed out is from) is installed.

    Do you have a small project that can reproduce this issue that you can share here? In the meantime, if you're not using Plastic SCM or Collaborate, then you can safely remove the Version Control package via the Package Manager to continue working as usual.
     
    Karsten likes this.
  3. Spellbook

    Spellbook

    Joined:
    May 21, 2015
    Posts:
    29
    We had removed the Collaborate component, but it seemed to leave behind DLLs in the /Library/ folder that continued to cause issues. It was resolved after removing it, re-building the visual studio solution, and also re-building the /Library/ folder.

    I've not had time to try re-creating this particular issue in a vacuum; I assume there was some conflict between our project's existing exception handling and PlasticSCM. The frustration came from a new, non-critical beta package installing itself unannounced in our project. Something like this should probably not be defaulted on, and users instead given the choice to opt-in if we're interested.
     
  4. Darhkuan

    Darhkuan

    Joined:
    Feb 24, 2014
    Posts:
    21
    Hi @ryanc-unity, apologies for digging this up a month later but I just ran into what I believe is the exactly same thing happening, where while following a debug I noticed that PlasticsApp.cs was being jumped to suddenly, and as Spellbook so aptly put it, eating errors and then having the code continue on. In my case it was around a foreach loop:

    foreach (X x in xs)
    {
    x.changed = false;
    }

    xs while it had been created had nothing in it yet. Upon correcting the error in my code and walking through it again the PlasticsApp.cs was no longer involved.

    I'm not the most technical person out there - so just passing on the experience. Given where a console error message was being thrown had me looking in all the wrong places for the issue.
     
    MilkTheGull likes this.
  5. MilkTheGull

    MilkTheGull

    Joined:
    Oct 18, 2020
    Posts:
    1
    Looks like we are not the first bit by this and given the lack of acknowledgement we wont be the last. not silently ignoring exceptions is some 101 level programming stuff. you should use throw syntax keyword to re throw an exception you dont intend to handle.
     
    Last edited: Feb 15, 2022