klammbueddel/txt2jira

Handle exception on non available/accessible issue

deeaitsch84 opened this issue · 0 comments

Expected behaviour

Exceptions must be handled gracefully

Actual behaviour

Application throws exception on non available issue

Steps to reproduce

  1. Add FOO-1337 I am a non existing issue to log file
  2. ./txt2jira commit will produce the following output and stops the exceution

`Exception {"errorMessages":["Issue does not exist or you do not have permission to see it."],"errors":{}}
(thrown in /Users/dennis/projects/tools/txt2jira/src/JiraClient.php:78)

Stack Trace:

  1. App\JiraClient->post('/rest/api/2/issue//worklog', ['', '2022-10-20T13:15:00.000+0000', '15'])
    at /Users/dennis/projects/tools/txt2jira/src/JiraClient.php:91
  2. App\JiraClient->addWorkLog('', '', DateTime, '15')
    at /Users/dennis/projects/tools/txt2jira/src/Exporter.php:21
  3. App\Exporter->export(***)
    at /Users/dennis/projects/tools/txt2jira/src/ExecuteCommand.php:66
  4. App\ExecuteCommand->execute(NULL, NULL, 5)
    at /Users/dennis/projects/tools/txt2jira/vendor/adhocore/cli/src/Application.php:348
  5. Ahc\Cli\Application->doAction(App\ExecuteCommand)
    at /Users/dennis/projects/tools/txt2jira/vendor/adhocore/cli/src/Application.php:272
  6. Ahc\Cli\Application->handle(['./txt2jira', 'commit'])
    at /Users/dennis/projects/tools/txt2jira/txt2jira:14`