Skip to content

Releases: ncoden/sass-errors

v0.4.1

20 Dec 02:18
Compare
Choose a tag to compare

Fix installation command (b0daa05)

v0.4.0

20 Dec 01:57
Compare
Choose a tag to compare

Major changes:

  • Add unit tests. (996a2fa)
  • Add documentation. (85e69ad)
  • Change se-try and se-try-catch behavior (see below).

Try/try-catch update

Fix: Make se-try taking the value to test instead of the function to call. (9eb8eac)

  • Rename the "catch function" $catch_func_name to "Exception Handler" $handler.
  • Make se-try-catch taking arguments to create a custom Exception on false value.

Note: The $handler function must be defined in the same scope as sass-errors-try-catch.

Other changes:

  • Add Travis
  • Use se-error as default catch function. (f26ad93)
  • Fix sass-errors-init persistent Exceptions. (f26ad93)
  • Fix sass-errors-message for empty error or prefix (7d0b771)

v0.3.0

18 Dec 01:55
Compare
Choose a tag to compare
v0.3.0 Pre-release
Pre-release

⚠️ Breaking changes.

Move from an Error approach to an Exception approach. Throw exceptions that have to be catch, instead of displaying an error.

Changes in approach:

  • A function have its normal behaviour, and throw an exception if something bad happen.
  • Only provide exceptions to create and throw
  • "False" is the only semantical value to return errors.
  • To retrieve the error type and message, the exception must be catch.

Changes in current functions:

  • sass-errors-init do not initalize errors options, but only prefix an global variables.
  • sass-errors-throw create an exception and save it globally. The exception will be retrieved later.
  • Remove sass-errors-obj and sass-errors-obj-throw

New functions behaviors: (*: global option)

  • @function sass-errors-init($prefix: null): initialize Sass Errors
  • @function sass-errors-new($error, $type: null, $datas: (), $prefix: *): create an Exception object and return it.
  • @function sass-errors-throw($error, $type: null, $datas: (), $prefix: *): create an Exception object and throw it. If an Exception is passed as first parameter, throw it. Always return false: this function should be called with @return.

New functions:

  • @function sass-errors-get(): return the current non-catched Exception.
  • @function sass-errors-is-exception(): return true if Exception has been thrown and not catched. false otherwise.
  • @function sass-errors-try($func_name, $func_args: ()): Call a function with its arguments. If the function return false without throwing Exceptions, throw an Exception.
  • @function sass-errors-catch($types...): If an Exception has been throw, return it. If types are given, return the Exception only if its type matches with one of the given types. Otherwise, return false.
  • @function sass-errors-try-catch($try_func_name, $try_func_args: (),$catch_func_name: null, $catch_func_args: (), $types: ()): Call a try function with its arguments. If the function return false or throw an Exception, catch it and pass the Exception to the given catch function with its arguments.
  • @function sass-errors-store($obj, $error, $type: null, $datas: (), $prefix: *): Create an Exception and append it to the given store. The new exception is not thrown.

Other changes:

  • Rename functions to use a sass-errors prefix instead of serr.
  • Add optional aliases for each function, with a se- prefix.
  • Add .editorconfig

📘 Documentation will be added soon.

v0.2.0

16 Dec 23:46
Compare
Choose a tag to compare
v0.2.0 Pre-release
Pre-release

Initial Release.

Initial functions:

Add basic functions for sass-errors:

  • serr-init: initialize sass-errors with a custom config
  • serr-message: return a formatted message from a error message and a prefix.
  • serr-obj: return a new sass-error object to iterate on it.
  • serr-throw: throw an single error.
  • serr-obj-throw: throw an error and store it in a sass-error object.