Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
picodata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
picodata
Commits
ec05176c
Commit
ec05176c
authored
7 months ago
by
Georgy Moshkin
Browse files
Options
Downloads
Patches
Plain Diff
chore: don't use name `Error` for such a useless thing
parent
d40e24f3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1209
plugin system cleanup
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugin/mod.rs
+3
-4
3 additions, 4 deletions
src/plugin/mod.rs
with
3 additions
and
4 deletions
src/plugin/mod.rs
+
3
−
4
View file @
ec05176c
...
...
@@ -7,7 +7,6 @@ pub mod topology;
use
once_cell
::
unsync
;
use
picoplugin
::
background
::
ServiceId
;
use
picoplugin
::
plugin
::
interface
::
ServiceBox
;
use
serde
::
de
::
Error
;
use
serde
::{
Deserialize
,
Serialize
};
use
std
::
fmt
::{
Display
,
Formatter
};
use
std
::
fs
::
File
;
...
...
@@ -60,7 +59,7 @@ pub enum PluginError {
#[error(
"Error while discovering manifest for plugin `{0}`: {1}"
)]
ManifestNotFound
(
String
,
io
::
Error
),
#[error(
"Error while parsing manifest `{0}`, reason: {1}"
)]
InvalidManifest
(
String
,
serde_yaml
::
Error
),
InvalidManifest
(
String
,
Box
<
dyn
std
::
error
::
Error
>
),
#[error(
"`{0}` service defenition not found"
)]
ServiceDefenitionNotFound
(
String
),
#[error(
"Read plugin_dir: {0}"
)]
...
...
@@ -234,12 +233,12 @@ impl Manifest {
})
?
;
let
manifest
:
Manifest
=
serde_yaml
::
from_reader
(
file
)
.map_err
(|
e
|
{
PluginError
::
InvalidManifest
(
manifest_path
.to_string_lossy
()
.to_string
(),
e
)
PluginError
::
InvalidManifest
(
manifest_path
.to_string_lossy
()
.to_string
(),
e
.into
()
)
})
?
;
if
manifest
.name
!=
plugin_name
||
manifest
.version
!=
version
{
return
Err
(
PluginError
::
InvalidManifest
(
manifest_path
.to_string_lossy
()
.to_string
(),
serde_yaml
::
Error
::
custom
(
"plugin name or version should be equal to manifest one"
),
"plugin name or version should be equal to manifest one"
.into
(
),
));
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment