Project

General

Profile

Actions

Bug #23241

open

Windows directives should catch exception at runtime

Added by Félix DALLIDET over 1 year ago. Updated 5 months ago.

Status:
New
Priority:
N/A
Assignee:
-
Category:
Server components
Target version:
Severity:
Minor - inconvenience | misleading | easy workaround
UX impact:
I dislike using that feature
User visibility:
Operational - other Techniques | Rudder settings | Plugins
Effort required:
Very Small
Priority:
72
Name check:
To do
Fix check:
To do
Regression:
No

Description

If for some reasons the directive call fails, the error is uncatched and just displayed in the output.
I have no idea on what to do with the exception yet, but it should be catched and logged.

The change should be easy to do at the generation process level by modifying the "RUDDER_DIRECTIVES_SEQUENCE" from:

  BeginDirectiveCall -Name 'Windows/Test windows' -Id 'b8fdadd6-eda6-4d2c-9fcf-829ee5c5d8b5'
  TestWindows -ReportId '0bfbf8af-89dc-4c67-805a-07c9c416aed0@@b8fdadd6-eda6-4d2c-9fcf-829ee5c5d8b5@@0' -TechniqueName 'test_windows' -PolicyMode ([Rudder.PolicyMode]::Enforce)
  EndDirectiveCall -Name 'Windows/Test windows' -Id 'b8fdadd6-eda6-4d2c-9fcf-829ee5c5d8b5'

to something like:

  BeginDirectiveCall -Name 'Windows/Test windows' -Id 'b8fdadd6-eda6-4d2c-9fcf-829ee5c5d8b5'
  try {
    TestWindows -ReportId '0bfbf8af-89dc-4c67-805a-07c9c416aed0@@b8fdadd6-eda6-4d2c-9fcf-829ee5c5d8b5@@0' -TechniqueName 'test_windows' -PolicyMode ([Rudder.PolicyMode]::Enforce)
  } catch {
    [Rudder.Logger]::Log.Error(
      ([String]::Format(
        'Directive "{0}" encountered an unexpected failure, see the error below:{1}{2}',
        '0bfbf8af-89dc-4c67-805a-07c9c416aed0@@b8fdadd6-eda6-4d2c-9fcf-829ee5c5d8b5@@0',
        "`n",
        (Format-Exception $_)[1]
      ))
    )
  }
  EndDirectiveCall -Name 'Windows/Test windows' -Id 'b8fdadd6-eda6-4d2c-9fcf-829ee5c5d8b5'

Related issues 1 (0 open1 closed)

Related to Rudder - Bug #23240: Windows technique generated function name is incoherent with the generated directivesReleasedFélix DALLIDETActions
Actions

Also available in: Atom PDF