psalm icon indicating copy to clipboard operation
psalm copied to clipboard

Psalm not warning of possible uncaught exception

Open dkjensen opened this issue 1 year ago • 1 comments

Example: https://psalm.dev/r/89df127ce8

I am new to using Psalm, is this not a feature of Psalm?

dkjensen avatar Jul 11 '24 15:07 dkjensen

I found these snippets:

https://psalm.dev/r/89df127ce8
<?php

function testUsesFunctionWithException( int $var ) : int {
    return testFunctionWithException( $var );
}

function testFunctionWithException( int $var ) : int {
  if ( $var === 1 ) {
   	throw new \Exception( 'Is one' );   
  }
    
  return 0;
}

testUsesFunctionWithException( 1 );
testUsesFunctionWithException( 0 );

testFunctionWithException( 1 );
Psalm output (using commit 16b24bd):

No issues!

psalm-github-bot[bot] avatar Jul 11 '24 15:07 psalm-github-bot[bot]