sillsdev / sillsdev/chorus

exception handling around GetDrives()?

Open
#261 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
5
Forks
26
PR merge metrics
No merged PRs in 30d

Description

Some of the users of Chorus in OSE get the below exception stack (green screen of death). I think in the past it was when maybe they had something plugged into a USB port... Is it possible to add exception catching if GetDrives() fails?

Msg: Invalid class 
Class: System.Management.ManagementException
Source: System.Management
Assembly: System.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Stack:    at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
   at System.Management.ManagementObjectCollection.ManagementObjectEnumerator.MoveNext()
   at SIL.UsbDrive.Windows.UsbDriveInfoWindows.GetDrives() in C:\BuildAgent\work\a868e9f1d5fee9d4\SIL.Core.Desktop\UsbDrive\Windows\UsbDriveInfoWindows.cs:line 69
   at SIL.UsbDrive.UsbDriveInfo.GetDrives() in C:\BuildAgent\work\a868e9f1d5fee9d4\SIL.Core.Desktop\UsbDrive\UsbDriveInfo.cs:line 112
   at Chorus.UI.UsbDriveLocator.ScanForUsbDrives()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
Thread: 
Thread UI culture: en-US
Exception: System.Management.ManagementException

--Error Reporting Properties--
Version: Version 4.2.7 (apparent build date: 30-Mar-2021)
CommandLine: "C:\Program Files (x86)\SIL\OneStory Editor\StoryEditor.exe" 
CurrentDirectory: C:\Program Files (x86)\SIL\OneStory Editor
MachineName: ARIKA
OSVersion: Windows 10 
DotNetVersion: 4.0.30319.42000
WorkingSet: 25501696
UserDomainName: ARIKA
UserName: Admin
Culture: en-US
KeyboardAdaptors: WinKeyboardAdaptor

--Log--
Thursday, September 2, 2021
9:09:45 AM	App Launched with ["C:\Program Files (x86)\SIL\OneStory Editor\StoryEditor.exe" ]
9:09:46 AM	Keyboard adaptors in use: WinKeyboardAdaptor
9:09:47 AM	Exception: Invalid class 
Details of most recent events:
9:09:45 AM	App Launched with ["C:\Program Files (x86)\SIL\OneStory Editor\StoryEditor.exe" ]
9:09:46 AM	Keyboard adaptors in use: WinKeyboardAdaptor
9:09:47 AM	Exception: Invalid class 


To Reproduce: 

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with SIL.UsbDrive.Windows.UsbDriveInfoWindows.GetDrives() at line 69, then review SIL.UsbDrive.UsbDriveInfo.GetDrives() and Chorus.UI.UsbDriveLocator.ScanForUsbDrives(). Reproduce or inspect the System.Management.ManagementException path and verify that a failed drive scan no longer produces the reported unhandled exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.