-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into hansl/canister-names
- Loading branch information
Showing
15 changed files
with
150 additions
and
114 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
use std::fmt; | ||
|
||
/// An error happened during build. | ||
#[derive(Debug)] | ||
pub enum BuildErrorKind { | ||
/// Invalid extension. | ||
InvalidExtension(String), | ||
|
||
/// A compiler error happened. | ||
MotokoCompilerError(String), | ||
|
||
/// An error happened during the generation of the Idl. | ||
IdlGenerationError(String), | ||
|
||
/// An error happened while generating the user library. | ||
UserLibGenerationError(String), | ||
|
||
/// An error happened while compiling WAT to WASM. | ||
WatCompileError(wabt::Error), | ||
} | ||
|
||
impl fmt::Display for BuildErrorKind { | ||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
use BuildErrorKind::*; | ||
|
||
match self { | ||
InvalidExtension(ext) => f.write_fmt(format_args!("Invalid extension: {}", ext)), | ||
MotokoCompilerError(stdout) => { | ||
f.write_fmt(format_args!("Motoko returned an error:\n{}", stdout)) | ||
} | ||
IdlGenerationError(stdout) => f.write_fmt(format_args!( | ||
"IDL generation returned an error:\n{}", | ||
stdout | ||
)), | ||
UserLibGenerationError(stdout) => f.write_fmt(format_args!( | ||
"UserLib generation returned an error:\n{}", | ||
stdout | ||
)), | ||
WatCompileError(e) => { | ||
f.write_fmt(format_args!("Error while compiling WAT to WASM: {}", e)) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
use std::fmt; | ||
use std::io; | ||
use std::path::PathBuf; | ||
|
||
/// An error happened during build. | ||
#[derive(Debug)] | ||
pub enum CacheErrorKind { | ||
CannotFindUserHomeDirectory(), | ||
CannotCreateCacheDirectory(PathBuf, io::Error), | ||
CacheShouldBeADirectory(PathBuf), | ||
UnknownDfxVersion(String), | ||
} | ||
|
||
impl fmt::Display for CacheErrorKind { | ||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
use CacheErrorKind::*; | ||
|
||
match self { | ||
CannotFindUserHomeDirectory() => f.write_str("Cannot find the home directory."), | ||
CannotCreateCacheDirectory(path, io_err) => f.write_fmt(format_args!( | ||
r#"Could not create the cache folder at "{}". Error: {}"#, | ||
path.display(), | ||
io_err, | ||
)), | ||
|
||
CacheShouldBeADirectory(path) => f.write_fmt(format_args!( | ||
r#"Cache folder "{}" should be a directory or a symlink to a directory."#, | ||
path.display(), | ||
)), | ||
|
||
UnknownDfxVersion(version) => f.write_fmt(format_args!("Unknown version: {}", version)), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
actor HelloActor { | ||
public func hello() : async () { | ||
print("Hello, World! from DFINITY \n"); | ||
debugPrint("Hello, World! from DFINITY \n"); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.