task: metadata: install: pip install -e .[dev]
patch: diff --git a/news/201.bugfix b/news/201.bugfix
new file mode 100644
index 0000000..0ef9e8e
--- /dev/null
+++ b/news/201.bugfix
@@ -0,0 +1,1 @@
+Define a board as unknown if it cannot be identified locally when unable to access the online database.
diff --git a/src/mbed_tools/targets/_internal/board_database.py b/src/mbed_tools/targets/_internal/board_database.py
index 6745f65..3619cba 100644
--- a/src/mbed_tools/targets/_internal/board_database.py
+++ b/src/mbed_tools/targets/_internal/board_database.py
@@ -106,5 +106,5 @@ def _get_request() -> requests.Response:
     try:
         return requests.get(_BOARD_API, headers=header)
     except requests.exceptions.ConnectionError as connection_error:
-        logger.warning("There was an error connecting to the online database. Please check your internet connection.")
+        logger.warning("Unable to connect to the online database. Please check your internet connection.")
         raise BoardAPIError("Failed to connect to the online database.") from connection_error
diff --git a/src/mbed_tools/targets/get_board.py b/src/mbed_tools/targets/get_board.py
index 5bd99b5..1760fe9 100644
--- a/src/mbed_tools/targets/get_board.py
+++ b/src/mbed_tools/targets/get_board.py
@@ -11,7 +11,7 @@ from enum import Enum
 from typing import Callable
 
 from mbed_tools.targets.env import env
-from mbed_tools.targets.exceptions import UnknownBoard, UnsupportedMode
+from mbed_tools.targets.exceptions import UnknownBoard, UnsupportedMode, BoardDatabaseError
 from mbed_tools.targets.board import Board
 from mbed_tools.targets.boards import Boards
 
@@ -70,7 +70,11 @@ def get_board(matching: Callable) -> Board:
         return Boards.from_offline_database().get_board(matching)
     except UnknownBoard:
         logger.info("Unable to identify a board using the offline database, trying the online database.")
-        return Boards.from_online_database().get_board(matching)
+        try:
+            return Boards.from_online_database().get_board(matching)
+        except BoardDatabaseError:
+            logger.error("Unable to access the online database to identify a board.")
+            raise UnknownBoard()
 
 
 class _DatabaseMode(Enum):

problem_statement: Obtuse error message when board is not found locally or remotely
### Description

When a board is being looked for, and it isn't found in the offline database, and no network connectivity is available (say, perhaps [when a proxy is required to access the net](https://github.com/ARMmbed/mbed-tools/issues/200), the error message we receive is as follows:

```
$ mbedtools detect -a
ERROR: A problem occurred when looking up board data for connected devices.

More information may be available by using the command line option '-v'.
```

Using verbose output isn't too much better.

```
$ mbedtools -vvv detect -a
DEBUG: Failed getting an attribute value: <unknown>.AdditionalAvailability
DEBUG: Failed getting an attribute value: <unknown>.IdentifyingDescriptions
DEBUG: Failed getting an attribute value: <unknown>.MaxQuiesceTime
DEBUG: Failed getting an attribute value: <unknown>.OtherIdentifyingInfo
DEBUG: Failed getting an attribute value: <unknown>.PowerOnHours
DEBUG: Failed getting an attribute value: <unknown>.TotalPowerOnHours
DEBUG: Failed getting an attribute value: <unknown>.AdditionalAvailability
DEBUG: Failed getting an attribute value: <unknown>.IdentifyingDescriptions
DEBUG: Failed getting an attribute value: <unknown>.MaxQuiesceTime
DEBUG: Failed getting an attribute value: <unknown>.OtherIdentifyingInfo
DEBUG: Failed getting an attribute value: <unknown>.PowerOnHours
DEBUG: Failed getting an attribute value: <unknown>.TotalPowerOnHours
DEBUG: Failed getting an attribute value: <unknown>.AdditionalAvailability
DEBUG: Failed getting an attribute value: <unknown>.IdentifyingDescriptions
DEBUG: Failed getting an attribute value: <unknown>.MaxQuiesceTime
DEBUG: Failed getting an attribute value: <unknown>.OtherIdentifyingInfo
DEBUG: Failed getting an attribute value: <unknown>.PowerOnHours
DEBUG: Failed getting an attribute value: <unknown>.TotalPowerOnHours
DEBUG: Failed getting an attribute value: <unknown>.AdditionalAvailability
DEBUG: Failed getting an attribute value: <unknown>.IdentifyingDescriptions
DEBUG: Failed getting an attribute value: <unknown>.MaxQuiesceTime
DEBUG: Failed getting an attribute value: <unknown>.OtherIdentifyingInfo
DEBUG: Failed getting an attribute value: <unknown>.PowerOnHours
DEBUG: Failed getting an attribute value: <unknown>.TotalPowerOnHours
DEBUG: Failed getting an attribute value: <unknown>.AdditionalAvailability
DEBUG: Failed getting an attribute value: <unknown>.IdentifyingDescriptions
DEBUG: Failed getting an attribute value: <unknown>.MaxQuiesceTime
DEBUG: Failed getting an attribute value: <unknown>.OtherIdentifyingInfo
DEBUG: Failed getting an attribute value: <unknown>.PowerOnHours
DEBUG: Failed getting an attribute value: <unknown>.TotalPowerOnHours
DEBUG: Cannot retrieve the real name of volume Y:\. Reason: (87, 'GetVolumeNameForVolumeMountPoint', 'The parameter is incorrect.')
DEBUG: Attribute [DiskIndex] is undefined on this instance DiskPartition({}): 'DiskPartition' object has no attribute 'DiskIndex'
DEBUG: Attribute [PNPDeviceID] is undefined on this instance DiskDrive({}): 'DiskDrive' object has no attribute 'PNPDeviceID'
DEBUG: Attribute [SerialNumber] is undefined on this instance DiskDrive({}): 'DiskDrive' object has no attribute 'SerialNumber'
DEBUG: Attribute [DeviceID] is undefined on this instance DiskPartition({}): 'DiskPartition' object has no attribute 'DeviceID'
DEBUG: Attribute [Type] is undefined on this instance DiskPartition({}): 'DiskPartition' object has no attribute 'Type'
DEBUG: Attribute [Caption] is undefined on this instance DiskDrive({}): 'DiskDrive' object has no attribute 'Caption'
DEBUG: Attribute [DeviceID] is undefined on this instance DiskDrive({}): 'DiskDrive' object has no attribute 'DeviceID'
DEBUG: Attribute [Model] is undefined on this instance DiskDrive({}): 'DiskDrive' object has no attribute 'Model'
DEBUG: Attribute [InterfaceType] is undefined on this instance DiskDrive({}): 'DiskDrive' object has no attribute 'InterfaceType'
DEBUG: Attribute [MediaType] is undefined on this instance DiskDrive({}): 'DiskDrive' object has no attribute 'MediaType'
DEBUG: Attribute [Manufacturer] is undefined on this instance DiskDrive({}): 'DiskDrive' object has no attribute 'Manufacturer'
DEBUG: Attribute [SerialNumber] is undefined on this instance DiskDrive({}): 'DiskDrive' object has no attribute 'SerialNumber'
DEBUG: Attribute [Status] is undefined on this instance DiskDrive({}): 'DiskDrive' object has no attribute 'Status'
DEBUG: Attribute [PNPDeviceID] is undefined on this instance DiskDrive({}): 'DiskDrive' object has no attribute 'PNPDeviceID'
DEBUG: Cannot retrieve the real name of volume Y:\. Reason: (87, 'GetVolumeNameForVolumeMountPoint', 'The parameter is incorrect.')
DEBUG: Attribute [DiskIndex] is undefined on this instance DiskPartition({}): 'DiskPartition' object has no attribute 'DiskIndex'
DEBUG: Attribute [PNPDeviceID] is undefined on this instance DiskDrive({}): 'DiskDrive' object has no attribute 'PNPDeviceID'
DEBUG: Attribute [SerialNumber] is undefined on this instance DiskDrive({}): 'DiskDrive' object has no attribute 'SerialNumber'
DEBUG: Attribute [DeviceID] is undefined on this instance DiskPartition({}): 'DiskPartition' object has no attribute 'DeviceID'
DEBUG: Attribute [Type] is undefined on this instance DiskPartition({}): 'DiskPartition' object has no attribute 'Type'
DEBUG: Attribute [Caption] is undefined on this instance DiskDrive({}): 'DiskDrive' object has no attribute 'Caption'
DEBUG: Attribute [DeviceID] is undefined on this instance DiskDrive({}): 'DiskDrive' object has no attribute 'DeviceID'
DEBUG: Attribute [Model] is undefined on this instance DiskDrive({}): 'DiskDrive' object has no attribute 'Model'
DEBUG: Attribute [InterfaceType] is undefined on this instance DiskDrive({}): 'DiskDrive' object has no attribute 'InterfaceType'
DEBUG: Attribute [MediaType] is undefined on this instance DiskDrive({}): 'DiskDrive' object has no attribute 'MediaType'
DEBUG: Attribute [Manufacturer] is undefined on this instance DiskDrive({}): 'DiskDrive' object has no attribute 'Manufacturer'
DEBUG: Attribute [SerialNumber] is undefined on this instance DiskDrive({}): 'DiskDrive' object has no attribute 'SerialNumber'
DEBUG: Attribute [Status] is undefined on this instance DiskDrive({}): 'DiskDrive' object has no attribute 'Status'
DEBUG: Attribute [PNPDeviceID] is undefined on this instance DiskDrive({}): 'DiskDrive' object has no attribute 'PNPDeviceID'
INFO: Using the offline database to identify boards.
INFO: Unable to identify a board using the offline database, trying the online database.
DEBUG: Starting new HTTPS connection (1): os.mbed.com:443
WARNING: There was an error connecting to the online database. Please check your internet connection.
ERROR: A problem occurred when looking up board data for connected devices.

More information may be available by using the command line option '--traceback'.
```

Instead of failing with an error when we can't access the online board database, we should accept the board is unknown and display a user-friendly message, explaining that the board is unknown in the local database and that we couldn't access the online database, so we have to consider the board as unknown.

This issue is a subset of the issues reported in https://github.com/ARMmbed/mbed-tools/issues/186


### Issue request type

<!--
Please add only one `x` to one of the following types. Do not fill multiple types (split the issue otherwise).


For questions please use https://forums.mbed.com/
-->

- [ ] Enhancement
- [X] Bug

repo: ARMmbed/mbed-tools
test_cmd: pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
test_patch: diff --git a/tests/targets/test_get_board.py b/tests/targets/test_get_board.py
index d2e5b69..0398f4a 100644
--- a/tests/targets/test_get_board.py
+++ b/tests/targets/test_get_board.py
@@ -5,6 +5,8 @@
 """Tests for `mbed_tools.targets.get_board`."""
 from unittest import mock, TestCase
 
+from mbed_tools.targets._internal.exceptions import BoardAPIError
+
 # Import from top level as this is the expected interface for users
 from mbed_tools.targets import get_board_by_online_id, get_board_by_product_code
 from mbed_tools.targets.get_board import (
@@ -59,6 +61,17 @@ class TestGetBoard(TestCase):
         mocked_boards.from_offline_database().get_board.assert_called_once_with(fn)
         mocked_boards.from_online_database().get_board.assert_called_once_with(fn)
 
+    def test_auto_mode_raises_when_board_not_found_offline_with_no_network(self, env, mocked_boards):
+        env.MBED_DATABASE_MODE = "AUTO"
+        mocked_boards.from_offline_database().get_board.side_effect = UnknownBoard
+        mocked_boards.from_online_database().get_board.side_effect = BoardAPIError
+        fn = mock.Mock()
+
+        with self.assertRaises(UnknownBoard):
+            get_board(fn)
+        mocked_boards.from_offline_database().get_board.assert_called_once_with(fn)
+        mocked_boards.from_online_database().get_board.assert_called_once_with(fn)
+
 
 class TestGetBoardByProductCode(TestCase):
     @mock.patch("mbed_tools.targets.get_board.get_board")