Skip to content

Commit

Permalink
Better Error Message 😊
Browse files Browse the repository at this point in the history
	modified:   Cargo.lock
	modified:   Cargo.toml
	modified:   README.md
	modified:   examples/basic.rs
	modified:   src/graphics_capture_api.rs
	modified:   src/lib.rs
	modified:   windows-capture-python/Cargo.lock
	modified:   windows-capture-python/Cargo.toml
	modified:   windows-capture-python/pyproject.toml
  • Loading branch information
NiiightmareXD committed Nov 25, 2023
1 parent 97021e5 commit 6df8228
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "windows-capture"
version = "1.0.35"
version = "1.0.36"
authors = ["NiiightmareXD"]
edition = "2021"
description = "Fastest Windows Screen Capture Library For Rust 🔥"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Add this library to your `Cargo.toml`:

```toml
[dependencies]
windows-capture = "1.0.35"
windows-capture = "1.0.36"
```
or run this command

Expand Down Expand Up @@ -88,8 +88,8 @@ fn main() {
foreground_window,
// Capture Cursor
Some(true),
// Draw Borders
Some(false),
// Draw Borders (None Means Default Api Configuration)
None,
// Kind Of Pixel Format For Frame To Have
ColorFormat::Rgba8,
// Will Be Passed To The New Function
Expand Down
4 changes: 2 additions & 2 deletions examples/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ fn main() {
foreground_window,
// Capture Cursor
Some(true),
// Draw Borders
Some(false),
// Draw Borders (None Means Default Api Configuration)
None,
// Kind Of Pixel Format For Frame To Have
ColorFormat::Rgba8,
// Will Be Passed To The New Function
Expand Down
8 changes: 4 additions & 4 deletions src/graphics_capture_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ pub enum WindowsCaptureError {
#[error("Graphics Capture API Is Not Supported")]
Unsupported,
#[error("Graphics Capture API Toggling Cursor Capture Is Not Supported")]
CursorUnsupported,
CursorConfigUnsupported,
#[error("Graphics Capture API Toggling Border Capture Is Not Supported")]
BorderUnsupported,
BorderConfigUnsupported,
#[error("Already Started")]
AlreadyStarted,
}
Expand Down Expand Up @@ -285,7 +285,7 @@ impl GraphicsCaptureApi {
.unwrap()
.SetIsCursorCaptureEnabled(self.capture_cursor.unwrap())?;
} else {
return Err(Box::new(WindowsCaptureError::CursorUnsupported));
return Err(Box::new(WindowsCaptureError::CursorConfigUnsupported));
}
}

Expand All @@ -299,7 +299,7 @@ impl GraphicsCaptureApi {
.unwrap()
.SetIsBorderRequired(self.draw_border.unwrap())?;
} else {
return Err(Box::new(WindowsCaptureError::BorderUnsupported));
return Err(Box::new(WindowsCaptureError::BorderConfigUnsupported));
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
//!
//! ```toml
//! [dependencies]
//! windows-capture = "1.0.35"
//! windows-capture = "1.0.36"
//! ```
//! or run this command
//!
Expand Down Expand Up @@ -91,8 +91,8 @@
//! foreground_window,
//! // Capture Cursor
//! Some(true),
//! // Draw Borders
//! Some(false),
//! // Draw Borders (None Means Default Api Configuration)
//! None,
//! // Kind Of Pixel Format For Frame To Have
//! ColorFormat::Rgba8,
//! // Will Be Passed To The New Function
Expand Down
2 changes: 1 addition & 1 deletion windows-capture-python/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion windows-capture-python/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "windows-capture-python"
version = "1.0.35"
version = "1.0.36"
authors = ["NiiightmareXD"]
edition = "2021"
description = "Fastest Windows Screen Capture Library For Python 🔥"
Expand Down
2 changes: 1 addition & 1 deletion windows-capture-python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "maturin"

[project]
name = "windows-capture"
version = "1.0.35"
version = "1.0.36"
description = "Fastest Windows Screen Capture Library For Python 🔥"
readme = "README.md"
requires-python = ">=3.9"
Expand Down

0 comments on commit 6df8228

Please sign in to comment.