mirror of
https://github.com/dart-lang/sdk
synced 2024-09-18 20:01:19 +00:00
Nicer message when attempting to use Observatory from dart_bootstrap, dart_precompiled_runtime or an unnamed badly configured build.
R=johnmccutchan@google.com Review-Url: https://codereview.chromium.org/2793603002 .
This commit is contained in:
parent
a5a65d09a4
commit
d0529c8638
|
@ -296,6 +296,12 @@ class Server {
|
|||
return;
|
||||
}
|
||||
|
||||
if (assets == null) {
|
||||
request.response.headers.contentType = ContentType.TEXT;
|
||||
request.response.write("This VM was built without the Observatory UI.");
|
||||
request.response.close();
|
||||
return;
|
||||
}
|
||||
Asset asset = assets[path];
|
||||
if (asset != null) {
|
||||
// Serving up a static asset (e.g. .css, .html, .png).
|
||||
|
|
|
@ -7,12 +7,12 @@ class Asset {
|
|||
/// Call to request assets from the embedder.
|
||||
@patch
|
||||
static HashMap<String, Asset> request() {
|
||||
HashMap<String, Asset> assets = new HashMap<String, Asset>();
|
||||
Uint8List tarBytes = _requestAssets();
|
||||
if (tarBytes == null) {
|
||||
return assets;
|
||||
return null;
|
||||
}
|
||||
List assetList = _decodeAssets(tarBytes);
|
||||
HashMap<String, Asset> assets = new HashMap<String, Asset>();
|
||||
for (int i = 0; i < assetList.length; i += 2) {
|
||||
var a = new Asset(assetList[i], assetList[i + 1]);
|
||||
assets[a.name] = a;
|
||||
|
|
Loading…
Reference in a new issue