Skip to content

Commit

Permalink
Throw an exception instead of returning a null value
Browse files Browse the repository at this point in the history
  • Loading branch information
duduita committed Aug 2, 2023
1 parent 6c086c9 commit 81f19b7
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 8 deletions.
2 changes: 0 additions & 2 deletions source/Meadow.Core/NetworkAdapterBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ public event NetworkConnectionHandler NetworkConnected
{
add
{
Resolver.Log.Info($"subscribe to NetworkConnected on {this.GetType().Name}");
_connected += value;
}
remove
{
Resolver.Log.Info($"unsubscribe to NetworkConnected on {this.GetType().Name}");
_connected -= value;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,6 @@ public string AtCmdsOutput
public List <CellNetwork> Scan()

Check failure on line 200 in source/implementations/f7/Meadow.F7/Devices/F7CellNetworkAdapter.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'CellNetwork' could not be found (are you missing a using directive or an assembly reference?)
{
scannedCellNetworks = Core.Interop.Nuttx.MeadowCellNetworkScanner();

if (scannedCellNetworks == null)
{
Resolver.Log.Error("No available networks found, please ensure that your device is in scanning mode.");
}

return scannedCellNetworks;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private static List<CellNetwork> Parse (string input)
}
else
{
return null;
throw new System.IO.IOException("No available networks found, please ensure that your device is in scanning mode.");
}
}
finally
Expand Down

0 comments on commit 81f19b7

Please sign in to comment.