Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Not implemented error class #15938

Merged
merged 1 commit into from Mar 21, 2023
Merged

Conversation

derrickmehaffy
Copy link
Member

@derrickmehaffy derrickmehaffy commented Feb 27, 2023

What does it do?

Implements the not implemented error class

Why is it needed?

Could be used for the DEITS feature and handle the error class

How to test it?

const utils = require('@strapi/utils');
const { NotImplementedError } = utils.errors;

module.exports = (policyContext, config, { strapi }) => {
  let blah = false

  if (blah === false) {
    throw new NotImplementedError('This isn\'t implemented', { policy: 'test' })
  } else {
    return true
  }
}

Related issue(s)/PR(s)

N/A

@derrickmehaffy derrickmehaffy added source: core:strapi Source is core/strapi package pr: enhancement This PR adds or updates some part of the codebase or features labels Feb 27, 2023
@derrickmehaffy derrickmehaffy self-assigned this Feb 27, 2023
@derrickmehaffy derrickmehaffy added the flag: documentation This PR requires a documentation update label Feb 27, 2023
@codecov
Copy link

codecov bot commented Feb 27, 2023

Codecov Report

Base: 58.42% // Head: 58.41% // Decreases project coverage by -0.02% ⚠️

Coverage data is based on head (40ccd06) compared to base (739fd86).
Patch coverage: 20.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15938      +/-   ##
==========================================
- Coverage   58.42%   58.41%   -0.02%     
==========================================
  Files        1546     1546              
  Lines       38229    38237       +8     
  Branches     7517     7519       +2     
==========================================
  Hits        22337    22337              
- Misses      13599    13604       +5     
- Partials     2293     2296       +3     
Flag Coverage Δ
back 47.37% <20.00%> (-0.03%) ⬇️
front 66.06% <ø> (ø)
unit_back 47.37% <20.00%> (-0.03%) ⬇️
unit_front 66.06% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/core/utils/lib/errors.js 41.89% <0.00%> (-5.08%) ⬇️
packages/core/strapi/lib/services/errors.js 46.66% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@Convly Convly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alexandrebodin
Copy link
Member

What's the status of this PR ?

@derrickmehaffy
Copy link
Member Author

Other than the docs it's ready. If you want to merge it, give me tmrw to make the docs

@alexandrebodin alexandrebodin removed the flag: documentation This PR requires a documentation update label Mar 21, 2023
@alexandrebodin
Copy link
Member

I'll merge while you do the doc PR this doesn't have to be synced :)

@alexandrebodin alexandrebodin added this to the 4.8.3 milestone Mar 21, 2023
@alexandrebodin alexandrebodin changed the title Implement the not implemented error class Add Not implemented error class Mar 21, 2023
@alexandrebodin alexandrebodin merged commit b07fc41 into main Mar 21, 2023
@alexandrebodin alexandrebodin deleted the feature/notImplementedError branch March 21, 2023 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: enhancement This PR adds or updates some part of the codebase or features source: core:strapi Source is core/strapi package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants