only run substr() on strings in Stacktrace.php

can only do substr() on strings, so let's not try otherwise. (Was getting an issue where with a Guzzle exception the $value was showing up as a resource. It is working with this change)