並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 19 件 / 19件

新着順 人気順

throwの検索結果1 - 19 件 / 19件

タグ検索の該当結果が少ないため、タイトル検索結果を表示しています。

throwに関するエントリは19件あります。 プログラミングphpjavascript などが関連タグです。 人気エントリには 『Promiseをthrowするのはなぜ天才的デザインなのか - Qiita』などがあります。
  • Promiseをthrowするのはなぜ天才的デザインなのか - Qiita

    ReactのConcurrent Modeが最初に発表されたのはもう1年近くも前のことです(記事執筆時点1)。Concurrent Modeはたいへん奥深い機能で正式版がたいへん待ち遠しいですが、Concurrent Modeの代名詞として多くのReactユーザーに知られているのはPromiseをthrowするというAPIデザインです。Concurrent Modeでは、コンポーネントがレンダリング時にPromiseをthrowすることで、レンダリングをサスペンドした(Promiseが解決されるまでレンダリングできない)ことを表します。 Concurrent Modeに関しては筆者の既存記事Concurrent Mode時代のReact設計論 (1) Concurrent Modeにおける非同期処理などをご参照いただきたいのですが、ここではPromiseをthrowするということ自体に焦点

      Promiseをthrowするのはなぜ天才的デザインなのか - Qiita
    • PHPの最高機能、配列を捨てよう!! / Throw away all PHP array now!!!

      At: PHPerKaigi 2023 ( https://phperkaigi.jp/2023/ ) Track A DateTime: 2023/3/25 10:20 (40min) Speaker: uzulla

        PHPの最高機能、配列を捨てよう!! / Throw away all PHP array now!!!
      • 私がthrowを使わない理由

        この記事について JavaScriptではthrow文という文を使うことで例外を投げることができます。 このthrow文ですが、私はレビューなどで例外を投げないでくださいというコメントをするのですがその理由とどのようにコードを変更すればよいのか、ということを書いておこうと思いました。 前提条件 この記事の内容は下記の条件を前提として書き進めていきます。 TypeScriptを採用していること フロントエンド開発の場合 Node.jsを利用したサーバーサイドのコードやCLIツールの開発、各種ライブラリの開発については本記事の対象に含まれないことをご了承下さい。 結論 先に結論から書いておくとTypeScriptを利用している場合例外はカスタムエラーを返却するか、Result型を利用するのがよいと思っています。 次の章からサンプルコードを用いながらthrow文を使った実例と、代替え案について記

          私がthrowを使わない理由
        • Why Palestinians throw stones: A reporter's notebook

          Palestinian protesters take part during clashes with Israeli soldiers at the border fence with Israel east of Khan Yunis in the southern Gaza Strip, Palestine, May 15, 2018. Israeli soldiers killed at least 60 Palestinians and wounded more than 2,700, Gaza Strip, as demonstrations on the Gaza-Israel border coincided with the controversial opening of the U.S. Embassy in Jerusalem. London -- The dat

            Why Palestinians throw stones: A reporter's notebook
          • AFP News Agency on Twitter: "Caught on camera at #Olympics . - Competitors throw up after finishing the triathlon. - Fun trunks at a swimmin… https://t.co/7OYK2O3bC5"

            Caught on camera at #Olympics . - Competitors throw up after finishing the triathlon. - Fun trunks at a swimmin… https://t.co/7OYK2O3bC5

              AFP News Agency on Twitter: "Caught on camera at #Olympics . - Competitors throw up after finishing the triathlon. - Fun trunks at a swimmin… https://t.co/7OYK2O3bC5"
            • Rails 6.1でreturnやbreakやthrowによるトランザクション終了が非推奨化(翻訳)|TechRacho by BPS株式会社

              概要 元サイトの許諾を得て翻訳・公開いたします。 英語記事: Rails has deprecated using return, break and throw to exit a transaction | Saeloun Blog 原文公開日: 2020/04/06 著者: Rohit Kumar サイト: Saeloun Blog | Ruby on Rails Consulting Company based in San Francisco and Boston | Page 1 | Saeloun Blog 2020/04/24: 初版公開 2023/10/13: 追記 Railsには長年の間、トランザクションをひそかにコミットする機能が入っていました(fc83920)。トランザクションの内部でreturnを呼び出すと、コネクション上のトランザクションを開きっぱなしにしない形

                Rails 6.1でreturnやbreakやthrowによるトランザクション終了が非推奨化(翻訳)|TechRacho by BPS株式会社
              • RxSwiftの基本となるObservableとHot/Cold変換、Sequenceの分岐を学ぶ - stone's throw

                コマンドラインでSwiftを実行する方法が分かったので、せっかくだから簡単に実行できるものを用意してRxSwiftの基礎と、Hot/Cold変換、さらにSequenceの分岐に関する理解を深めるためのコードを書いた。 Swiftってコマンドラインで実行できるんすよ swiftでインタプリタが立ち上がったり、swift filenameで実行できるのは知っていたけど、swift packageコマンドでパッケージを生成してライブラリと組み合わせたりもできるらしいことが分かった。 実際に作るとこんな感じ。 $ mkdir RxSwiftExecutable # cd RxSwiftExecutable $ swift package init --type executable Creating executable package: RxSwiftExecutable Creating Pa

                  RxSwiftの基本となるObservableとHot/Cold変換、Sequenceの分岐を学ぶ - stone's throw
                • async/awaitがモナドのDo記法と同じっぽいので検証。throwとcatchもモナドに対応させる - Qiita

                  JavaScriptにおいて、Promiseのthenを使った書き方を、async/awaitを使って書き換えられるわけですけども その書き換えって、Haskellのモナドでbind(>>=)を使った書き方を、Do記法に書き換えとそっくりじゃないですか? ということで、どんな感じで対応しているか検証してみます。 コードの全文は最後に載せますね。合わせて60行もないです。 Haskell側のモナドとして、Eitherモナドを使うことにします。 Haskellのコードはimport Data.Eitherしておきます。 記事を通して使う関数 まずは、Promiseやモナドを返す関数ohとyeahを用意します。

                    async/awaitがモナドのDo記法と同じっぽいので検証。throwとcatchもモナドに対応させる - Qiita
                  • Let’s Throw it Away: Authoritarianism Every Organization May Fall Into

                    I know this is sudden, but I am an ‘Anti-Authoritarian’. I, speaking from my experience of working in various organizations, personally believe authoritarian is not the right concept in work and am trying to create and work in teams without it. Let’s first check out the definition of ‘authoritarianism.’ “Authoritarianism is the attitude, ideology, and system of individuals or social organizations

                      Let’s Throw it Away: Authoritarianism Every Organization May Fall Into
                    • 【PHP8.0】throw文がthrow式になる - Qiita

                      throw expressionというRFCが投票中です。 最初のアイデアは2019/12/06のSebastiaan Andewegによるツイート。 Really liking the arrow functions in PHP 7.4 so far! Unfortunately already found one missing feature: you can't throw Exceptions from them. The following results in a 'unexpected T_THROW' syntax error: fn() => throw new Exception('nope'); Would've cleaned up my test, but alas. — Sebastiaan Andeweg (@sebandeweg) 2019年12月5日

                        【PHP8.0】throw文がthrow式になる - Qiita
                      • PHPでthrowしない例外ハンドリング

                        PHPカンファレンス沖縄2021で発表した資料です。 サマリー PHPでは、例外をthrowとtry-catch-finallyを使って処理する実装をすることが多いと思います。 対して、GoやScala、Rustなどthrow -> try-catch-finallyでの例外ハンドリングを実装せず、多値返却やEither、Resultなど結果とエラーを表すデータ型を使って例外処理を行う言語も存在します。 この資料では、PHPでGoやScala、Rustのようにthrowしない例外処理をどう実装していくのかと、実際に実装した結果どのようなメリット/デメリットが得られたのかを説明しています。

                          PHPでthrowしない例外ハンドリング
                        • Error の cause オプションによってエラーの再 throw 時にスタックトレースが失われるのを防ぐ【ES2022】 - Qiita

                          メッセージに error.message や error.trace を連結して入れるのも手ですが、メッセージとしては読みづらく使いづらいです。 よってこれまでは、コード全体のエントリポイントなどでまとめてエラーをキャッチしスタックトレースが失われない形で処理するなどしていたかと思います。 Error の cause オプション ES2022 で入った機能で、このように Error の第二引数にオプションで cause を渡せるようになりました。

                            Error の cause オプションによってエラーの再 throw 時にスタックトレースが失われるのを防ぐ【ES2022】 - Qiita
                          • Siege of Mariupol: Fresh Russian attacks throw evacuation into chaos

                            Mass evacuation postponed because of continued Russian shelling.

                              Siege of Mariupol: Fresh Russian attacks throw evacuation into chaos
                            • siftrss | Filter your RSS feeds and throw away the junk

                              Enter the URL of an RSS or Atom feed below, select your filters, and you'll get a link for a new feed. Subscribe to see only what you want to see! I want to items where the SiftRSS uses the Perl Compatible Regular Expressions (PCRE) flavor of regex. It supports partial matches, so /conx?/ matches "Wisconsin" and /(na){2}/ matches "bananas." After the closing / you can pass in modifiers such as i t

                              • [Jest] throw Matcherで例外処理のテストを実装してみた | DevelopersIO

                                こんにちは、CX事業本部 IoT事業部の若槻です。 今回は、JavaScript Testing FrameworkであるJestで、例外処理のテストを実装してみました。 やってみた Jestでは、.toThrow()というMactherが用意されており、これを使用して例外処理の評価を行うことができます。 .toThrow(error?) - Expect · Jest toThrowError()は.toThrow()のエイリアスです。クラス、エラーメッセージ、インスタンスオブジェクトなどを評価対象として指定できます。 example function drinkFlavor(flavor) { if (flavor == 'octopus') { throw new DisgustingFlavorError('yuck, octopus flavor'); } // Do some

                                  [Jest] throw Matcherで例外処理のテストを実装してみた | DevelopersIO
                                • process: Change default --unhandled-rejections=throw by dfabulich · Pull Request #33021 · nodejs/node

                                  You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

                                    process: Change default --unhandled-rejections=throw by dfabulich · Pull Request #33021 · nodejs/node
                                  • 並列実行した Promise で throw されても全てハンドルしたいときの方法(allSettled, finally, etc...)

                                    要諦 以下のアプローチが主な解決方法となるだろう Promise.allSettled で全ての Promise の解決を待ち、解決された値を用いて処理を行う(動機的後処理) Promise.all に渡した各処理に Promise.prototype.{then,catch,finally} を定義し、適切に後処理を行う(非同期的後処理) 各処理を中断可能に実装し、 catch された時点で中断命令を送る(中断) Thanks to @uhyo_ ハンドルしたいだけなら allSettled である必要はない旨のご指摘を頂いたため、本文趣旨を変更しました。 詳細 Promise.all の返却する Promise は何かしら 1 つでも throw された時点で Reject され解決される。 このとき他の Promise は中断されない 浮いたまま実行され続けている (fulfille

                                      並列実行した Promise で throw されても全てハンドルしたいときの方法(allSettled, finally, etc...)
                                    • 例外を throw しない PowerShell コマンドレットを try catch でトラップする

                                      PowerShell のコマンドレットは、エラー発生時に赤文字でエラーメッセージを表示します。 対話処理をしているときはこれで問題無いのですが、スクリプトでこれが発生した時に try catch でトラップしたいことがあります。 ところが、コマンドレットで発生するのはエラーであって、例外ではないため try catch ではトラップできません。 例えば、Rest API 叩くために Invoke-RestMethod 使って、エラーが帰ってきても赤色のエラーメッセージが表示されるだけです。 そんな時は、-ErrorAction オプションに Stop を指定すれば、エラー時に例外を throw してくれるので try catch でトラップできます。 例外発生時のメッセージは、$_.Exception.Message に格納されているので、これを使えばエラーメッセージをハンドリングすること

                                      • Throw Away Code

                                        Throw away code There’s an ongoing discussion about what makes Python better prototyping language than Rust (with Python being probably just the archetype of some scripted weakly-typed language). The thing is, I prefer doing my prototypes in Rust over Python. Apparently, I’m not the only one. So I wanted to share few things about what makes Rust viable for these kinds of throw-away coding sprints,

                                        1

                                        新着記事