PackagePackagetypeA library you install and call yourself.See every one →What this type is →independently maintainedindependently maintainedoriginPublished by one person or a small company outside SAP. Says nothing about quality; the readings say that.See every one →

throw

A minimalistic way to raise an ABAP exception, from a text passed directly or, with no argument, from the system fields a preceding MESSAGE statement filled, as a static method or through an interface.

zcl_throw raises a static exception from a text passed directly, as in throw( 'Something bad happened' ), or, called with no argument, from whatever a preceding MESSAGE statement wrote into the system fields. It can be called as a static method, through a new instance, or through the zif_throw interface a class implements to alias its own throw method to it. It stops at raising the exception; what a caller does when it catches one is outside its scope.

Facts

Latestv1.1.1ReleasedLast pushLicenceMIT

Where it sits

Lives in
Provides
Error handlingABAPError handlingcapabilityTurning a failure into a response a client can act on — protocol-correct error payloads, correlation, and a boundary between internal detail and what a caller sees.

Who is behind it

abapifyabapifyOrganisationMaintains this
In the atlas: maintains 9
@abapify
maintainerPetr PlenkovPersonContributes to this
In the atlas: contributes to 13
@ThePlenkov
1 contributor

Before choosing this

Signals

ActivityQuietRelease and repository quiet for 26 months

Both observable publication channels have been quiet for at least 24 full months. This may be normal for stable software; check whether its current state still fits your use.

What it declares

Every artifact

Type
Package
Origin
Independently maintained

As a package

Where it runs
does not say
Distributed through
does not say

Connections3

README

quoted from abapify/throw under MIT, read
abapify/throw/README.mdOn GitHub

Throw anything as exception

Throw any object as exception in a minimalistic way. The prototype for this class is native javascript throw.

Here is the idea

we should be able to do something like:

throw( 'Something bad happened' )

or even

message e001(zmy_message_class) with 'this` 'and' 'that' into data(lv_dummy).
throw( ).

In both cases we expect a static exception should be raised with a text message from a given text or just inherited from a system message. That's it.

Usage

Via static method
zcl_throw=>from( 'Error happenned' ).

or

message e001(zmy_message_class) with 'this` 'and' 'that' into data(lv_dummy).
zcl_throw=>from( ).
Via instance

Not sure if we even need this way, may be for extensions with inherited classes

new zcl_throw( )->throw( 'Error happenned' ).

or

message e001(zmy_message_class) with 'this` 'and' 'that' into data(lv_dummy).
new zcl_throw( )->throw( ).
Via interface

You can also implement ZIF_THROW interface in your class or just inherit from ZCL_THROW class

In short here is the pattern how you can use it:

class zcl_your_class definition.
  public section.
    interfaces zif_throw.    
  private section.
    aliases throw for zif_throw~throw.
    methods do_something raising cx_static_check.
endclass.
class zcl_your_class implementation.
  method zif_throw~throw.
    zcl_throw=>from( object ).
  endmethod.
  method do_something.
    if something_bad_happened( ).
      throw( 'Something bad happened' ).
    endif.
  endmethod.
endclass.

Dependencies

  • assert is used in unit tests for throw
MIT, read

History

Latest

v1.1.1

  1. v1.1.0

  2. v1.0.0

  3. v0.0.0

On npm
179downloads per week, npm
Weekly downloads for throw26 complete calendar weeks from 2026-04-20 to 2026-10-18; the latest total is 179.20 Apr – 26 Apr: 95527 Apr – 3 May: 9744 May – 10 May: 81011 May – 17 May: 91718 May – 24 May: 61125 May – 31 May: 4881 Jun – 7 Jun: 4488 Jun – 14 Jun: 38115 Jun – 21 Jun: 35922 Jun – 28 Jun: 38629 Jun – 5 Jul: 3346 Jul – 12 Jul: 51113 Jul – 19 Jul: 47220 Jul – 26 Jul: 58127 Jul – 2 Aug: 4093 Aug – 9 Aug: 50310 Aug – 16 Aug: 33217 Aug – 23 Aug: 51724 Aug – 30 Aug: 50431 Aug – 6 Sept: 5237 Sept – 13 Sept: 33914 Sept – 20 Sept: 46621 Sept – 27 Sept: 45828 Sept – 4 Oct: 3855 Oct – 11 Oct: 27112 Oct – 18 Oct: 179
Error handling
  1. ABAP-PRCFramework for multi-step ABAP processes with monitoring
  2. RESULT-for-ABAPResult pattern for ABAP instead of exceptions for expected failures
  3. EITHER-FOR-ABAPABAP class implementing the Either pattern
  4. sap-usi-exceptionShared root exception class and text getter for USI developments

Details

Sources3
dotabapdiscovered herechecked
github.com/git+ssh://git@github.com/anton-rudeshko/node-throw.gittree, pushes, contributors, CIchecked
README.mdquoted, and what the entry declareschecked

Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.

Compatibility and provenance
latestv1.1.1
first release
releases and cadence4, ~546d median
discovered viadotabap
first seen in the atlas
ecosystem and domainabap, protocols-and-apis
abaplint
issues under its own abaplint configuration0
lines246
statements137
objects5
files8
analysed, main
abaplint version2.120.84
Contributors1

From the repository’s contributor list, .

History in the atlas1
  1. First seen.
For your agent
Ref
artifact:abapify-throw
JSON
/artifacts/abapify-throw.json
MCP
Connecting an agent